Top Description Methods
org.hibernate.annotations

public @Interface Synchronize

extends Annotation
Annotations
@Target:TYPE, FIELD, METHOD
@Retention:RUNTIME
Imports
java.lang.annotation.Retention, .Target

Specifies a table or tables that hold state mapped by the annotated entity or collection.

If Hibernate is not aware that a certain table holds state mapped by an entity class or collection, then modifications might not be automatically synchronized with the database before a query is executed against that table, and the query might return stale data.

Ordinarily, Hibernate knows the tables containing the state of an entity or collection. This annotation might be necessary if:

By default, the table names specified by this annotation are interpreted as logical names, and are processed by org.hibernate.boot.model.naming.PhysicalNamingStrategy#toPhysicalTableName. But if logical=false, the table names will be treated as physical names, and will not be processed by the naming strategy.

Author
Sharath Reddy
See Also
org.hibernate.query.SynchronizeableQuery

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if they are logical names
logical
()

Specifies whether the table names given by value should be interpreted as logical or physical names.

public String[]
value()

Names of tables that hold state mapped by the annotated entity.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

logicalback to summary
public boolean logical()

Specifies whether the table names given by value should be interpreted as logical or physical names.

Returns:boolean

true if they are logical names

valueback to summary
public String[] value()

Names of tables that hold state mapped by the annotated entity. Updates to these tables must be flushed to the database before execution of any query which refers to the annotated entity.