public class UpdateExecutor extends Object
Constructor and Description |
---|
UpdateExecutor() |
Modifier and Type | Method and Description |
---|---|
static void |
executeTargetedCacheInvalidation(javax.persistence.EntityManager em,
Class<?> entityType,
List<Long> ids) |
static int |
executeUpdateQuery(javax.persistence.EntityManager em,
String template,
Object[] params,
org.hibernate.type.Type[] types,
List<Long> ids)
Deprecated.
Highly recommended not to use this method. This method results in global L2 cache region clearing. Use
executeUpdateQuery(EntityManager, String, String, Object[], Type[], List) instead. |
static int |
executeUpdateQuery(javax.persistence.EntityManager em,
String template,
String tableSpace,
Object[] params,
org.hibernate.type.Type[] types,
List<Long> ids)
Perform an update query using a String template and params.
|
@Deprecated public static int executeUpdateQuery(javax.persistence.EntityManager em, String template, Object[] params, org.hibernate.type.Type[] types, List<Long> ids)
executeUpdateQuery(EntityManager, String, String, Object[], Type[], List)
instead.em
- The entity manager to use for the persistence operationtemplate
- the overall update sql template. The IN clause parameter should be written using 'IN (%s)'.params
- any other params that are present in the sql template, other than the IN clause. Should be written using '?'. Should be in order. Can be null.types
- the Type
instances that identify the types for the params. Should be in order and match the length of params. Can be null.ids
- the ids to include in the IN clause.public static int executeUpdateQuery(javax.persistence.EntityManager em, String template, String tableSpace, Object[] params, org.hibernate.type.Type[] types, List<Long> ids)
em
- The entity manager to use for the persistence operationtemplate
- the overall update sql template. The IN clause parameter should be written using 'IN (%s)'.tableSpace
- optionally provide the table being impacted by this query. This value allows Hibernate to limit the scope of cache region invalidation. Otherwise, if left null, Hibernate will invalidate every cache region, which is generally not desirable. An empty String can be used to signify that no region should be invalidated.params
- any other params that are present in the sql template, other than the IN clause. Should be written using '?'. Should be in order. Can be null.types
- the Type
instances that identify the types for the params. Should be in order and match the length of params. Can be null.ids
- the ids to include in the IN clause.Copyright © 2022. All rights reserved.