Notes:
Example of Usage: Adding an area code.
UpdateAllQuery updateQuery = new UpdateAllQuery(Employee.class);
updateQuery.setSelectionCriteria(eb.get("areaCode").isNull());
updateQuery.addUpdate(eb.get("areaCode"), "613");
| Modifier and Type | Field and Description |
|---|---|
| protected HashMap |
| Access | Constructor and Description |
|---|---|
| public | |
| public | UpdateAllQuery(Class<?>
Class referenceClass)PUBLIC: Constructs an update all query for the Class type specified. |
| public | UpdateAllQuery(Class<?>
Class type to be considered referenceClass, Expression Expression selectionCriteria)PUBLIC: Constructs an update all query for the specified Class type and selection criteria. |
| public | UpdateAllQuery(Class<?>
Class type to be considered referenceClass, ExpressionBuilder ExpressionBuilder expressionBuilder)PUBLIC: Constructs an update all query for the Class type specified and the given ExpressionBuilder. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addUpdate(Expression
Expression Object level representation of a database query 'where' clause field, Object Object, the new value value)PUBLIC: Adds the update (SET) clause to the query. |
| public void | |
| public void | addUpdate(Expression
Expression, representation of a database query 'where' clause that describes the field field, Expression Expression, representation of a database query 'where' clause that describes the new value value)PUBLIC: Adds the update (SET) clause to the query. |
| public void | addUpdate(String
String, the name of the attribute attributeName, Expression Expression, the new value value)PUBLIC: Adds the update (SET) clause to the query. |
| protected void | |
| public Object | executeDatabaseQuery()
Implements abstract org. |
| protected QueryRedirector | getDefaultRedirector()
Overrides org. |
| public HashMap | |
| protected void | initializeQuerySpecificDefaultBuilder()
Overrides org. |
| public boolean | isUpdateAllQuery()
Overrides org. |
| protected void |
| m_updateClauses | back to summary |
|---|---|
| protected HashMap<K, V> m_updateClauses | |
| UpdateAllQuery | back to summary |
|---|---|
| public UpdateAllQuery() PUBLIC: Constructs a default update all query. | |
| UpdateAllQuery | back to summary |
|---|---|
| public UpdateAllQuery(Class<?> referenceClass) PUBLIC: Constructs an update all query for the Class type specified.
| |
| UpdateAllQuery | back to summary |
|---|---|
| public UpdateAllQuery(Class<?> referenceClass, Expression selectionCriteria) PUBLIC: Constructs an update all query for the specified Class type and selection criteria.
| |
| UpdateAllQuery | back to summary |
|---|---|
| public UpdateAllQuery(Class<?> referenceClass, ExpressionBuilder expressionBuilder) PUBLIC:
Constructs an update all query for the Class type specified and the given
ExpressionBuilder. This sets the default builder which is used for all associated
expressions in the query.
| |
| addUpdate | back to summary |
|---|---|
| public void addUpdate(Expression field, Object value) PUBLIC: Adds the update (SET) clause to the query. Uses default ExpressionBuilder.
| |
| addUpdate | back to summary |
|---|---|
| public void addUpdate(String attributeName, Object value) PUBLIC: Adds the update (SET) clause to the query. Uses default ExpressionBuilder. | |
| addUpdate | back to summary |
|---|---|
| public void addUpdate(Expression field, Expression value) PUBLIC: Adds the update (SET) clause to the query. This method ensures that the builder has the session and reference class set for both given Expressions. Uses default ExpressionBuilder.
| |
| addUpdate | back to summary |
|---|---|
| public void addUpdate(String attributeName, Expression value) PUBLIC: Adds the update (SET) clause to the query. Uses default ExpressionBuilder.
| |
| addUpdateInternal | back to summary |
|---|---|
| protected void addUpdateInternal(Object fieldObject, Object valueObject) INTERNAL: | |
| executeDatabaseQuery | back to summary |
|---|---|
| public Object executeDatabaseQuery() throws DatabaseException Implements abstract org. INTERNAL: Issue the SQL to the database and then merge into the cache. If we are within a UoW, the merge to the cache must not be done until the UoW merges into the parent. The UoW will trigger the merge to occur at the correct time and will ensure the cache setting is set to none at that time.
| |
| getDefaultRedirector | back to summary |
|---|---|
| protected QueryRedirector getDefaultRedirector() Overrides org. INTERNAL: Returns the specific default redirector for this query type. There are numerous default query redirectors. See ClassDescriptor for their types.
| |
| getUpdateClauses | back to summary |
|---|---|
| public HashMap INTERNAL: Return the updates stored for an update all query | |
| initializeQuerySpecificDefaultBuilder | back to summary |
|---|---|
| protected void initializeQuerySpecificDefaultBuilder() Overrides org. INTERNAL: Initialize the expression builder which should be used for this query. If there is a where clause, use its expression builder. If after this method defaultBuilder is still null, then initializeDefaultBuilder method will generate and cache it.
| |
| isUpdateAllQuery | back to summary |
|---|---|
| public boolean isUpdateAllQuery() Overrides org. INTERNAL: Return true if this is an update all query.
| |
| prepare | back to summary |
|---|---|
| protected void prepare() throws QueryException Overrides org. INTERNAL:
| |