Top Description Methods
org.hibernate

public Interface SynchronizeableQuery<T>

Known Direct Subinterfaces
org.hibernate.procedure.ProcedureCall, org.hibernate.query.NativeQuery, org.hibernate.SQLQuery
Annotations
@SuppressWarnings:unused, UnusedReturnValue, RedundantSuppression
Imports
java.util.Collection

A unifying interface for queries which can define tables (query spaces) to synchronize on. These query spaces affect the process of auto-flushing by determining which entities will be processed by auto-flush based on the table to which those entities are mapped and which are determined to have pending state changes. In a similar manner, these query spaces also affect how query result caching can recognize invalidated results.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public SynchronizeableQuery<T>

Returns:

this, for method chaining
addSynchronizedEntityClass
(Class<T>
The class of the entity upon whose defined query spaces we should additionally synchronize.
entityClass
)

Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking.

public default SynchronizeableQuery<T>
addSynchronizedEntityClass(Class<?>... entityClasses)

Adds one-or-more entities (by class) whose tables should be added as synchronized spaces

public SynchronizeableQuery<T>

Returns:

this, for method chaining
addSynchronizedEntityName
(String
The name of the entity upon whose defined query spaces we should additionally synchronize.
entityName
)

Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking.

public default SynchronizeableQuery<T>
addSynchronizedEntityName(String... entityNames)

Adds one-or-more entities (by name) whose tables should be added as synchronized spaces

public SynchronizeableQuery<T>

Returns:

this, for method chaining
addSynchronizedQuerySpace
(String
The query space to be auto-flushed for this query.
querySpace
)

Adds a query space.

public default SynchronizeableQuery<T>
addSynchronizedQuerySpace(String... querySpaces)

Adds one-or-more synchronized spaces

public default SynchronizeableQuery<T>
addSynchronizedTable(String tableExpression)

Adds a table expression as a query space.

public default SynchronizeableQuery<T>
addSynchronizedTable(String... tableExpressions)

Adds one-or-more synchronized table expressions

public Collection<String>

Returns:

The list of query spaces upon which the query is synchronized.
getSynchronizedQuerySpaces
()

Obtain the list of query spaces the query is synchronized on.

Method Detail

addSynchronizedEntityClassback to summary
public SynchronizeableQuery<T> addSynchronizedEntityClass(Class<T> entityClass) throws MappingException

Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking. Same as addSynchronizedQuerySpace for all tables associated with the given entity.

Parameters
entityClass:Class<T>

The class of the entity upon whose defined query spaces we should additionally synchronize.

Returns:SynchronizeableQuery<T>

this, for method chaining

Annotations
@SuppressWarnings:rawtypes
Exceptions
MappingException:
Indicates the given class could not be resolved as an entity
addSynchronizedEntityClassback to summary
public default SynchronizeableQuery<T> addSynchronizedEntityClass(Class<?>... entityClasses) throws MappingException

Adds one-or-more entities (by class) whose tables should be added as synchronized spaces

addSynchronizedEntityNameback to summary
public SynchronizeableQuery<T> addSynchronizedEntityName(String entityName) throws MappingException

Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking. Same as addSynchronizedQuerySpace for all tables associated with the given entity.

Parameters
entityName:String

The name of the entity upon whose defined query spaces we should additionally synchronize.

Returns:SynchronizeableQuery<T>

this, for method chaining

Exceptions
MappingException:
Indicates the given name could not be resolved as an entity
addSynchronizedEntityNameback to summary
public default SynchronizeableQuery<T> addSynchronizedEntityName(String... entityNames) throws MappingException

Adds one-or-more entities (by name) whose tables should be added as synchronized spaces

addSynchronizedQuerySpaceback to summary
public SynchronizeableQuery<T> addSynchronizedQuerySpace(String querySpace)

Adds a query space.

Parameters
querySpace:String

The query space to be auto-flushed for this query.

Returns:SynchronizeableQuery<T>

this, for method chaining

addSynchronizedQuerySpaceback to summary
public default SynchronizeableQuery<T> addSynchronizedQuerySpace(String... querySpaces)

Adds one-or-more synchronized spaces

addSynchronizedTableback to summary
public default SynchronizeableQuery<T> addSynchronizedTable(String tableExpression)

Adds a table expression as a query space.

addSynchronizedTableback to summary
public default SynchronizeableQuery<T> addSynchronizedTable(String... tableExpressions)

Adds one-or-more synchronized table expressions

getSynchronizedQuerySpacesback to summary
public Collection<String> getSynchronizedQuerySpaces()

Obtain the list of query spaces the query is synchronized on.

Returns:Collection<String>

The list of query spaces upon which the query is synchronized.