Package org.hibernate.annotations
The JPA specification perfectly nails many aspects of the O/R persistence problem, but here we address some areas where it falls short.
Basic types in JPA
A basic type handles the persistence of an attribute of an entity or embeddable object that is stored in exactly one database column.
JPA supports a very limited set of built-in basic types.
| Category | Package | Types |
| Primitive types | boolean, int, double, etc. |
|
| Primitive wrappers | java.lang |
Boolean, Integer, Double, etc. |
| Strings | java.lang |
String |
| Arbitrary-precision numeric types | java.math | BigInteger, BigDecimal |
| Date/time types | java.time |
LocalDate, LocalTime, LocalDateTime, OffsetDateTime, Instant |
| Deprecated date/time types | java.util |
Date, Calendar |
| Deprecated JDBC date/time types | java.sql |
Date, Time, Timestamp |
| Binary and character arrays | byte[], char[] |
|
| UUIDs | java.util |
UUID |
| Enumerated types | Any enum |
|
| Serializable types | Any java.io.Serializable |
JPA does provide converters as an extensibility mechanism, but its converters are only useful for classes which have an equivalent representation as one of the types listed above.
Basic value type mappings
By contrast, Hibernate has an embarrassingly rich set of abstractions for modelling basic types, which can be initially confusing.
Note that the venerable interface Type abstracts over all
sorts of field and property types, not only basic types. In modern Hibernate, programs
should avoid direct use of this interface.
Instead, a program should use either a "compositional" basic type, or in more extreme
cases, a UserType.
A basic type is a composition of a
JavaTypewith aJdbcType, and possibly a JPAAttributeConverter, and the process of composition is usually somewhat implicit.A converter may be selected using the JPA
Convertannotation, or it may be applied implicitly.A
JavaTypeorJdbcTypemay be indicated explicitly using the following annotations:But these annotation also influence the choice:
Furthermore, a
JavaTypeRegistrationorJdbcTypeRegistrationallows the choice ofJavaTypeorJdbcTypeto be made implicitly.A compositional type mapping also comes with a
MutabilityPlan, which is usually chosen by theJavaType, but which may be overridden using theMutabilityannotation.
Note that
JavaType,JdbcType,JdbcTypeCodeandMutabilityall come in specialized flavors for handling map keys, list indexes, and so on.Alternatively, a program may implement the
UserTypeinterface and associate it with a field or property- explicitly, using the
@Typeannotation, or - implicitly, using the
@TypeRegistrationannotation.
There are some specialized flavors of the
@Typeannotation too.- explicitly, using the
These two approaches cannot be used together. A UserType always takes precedence
over the compositional approach.
All the typing annotations just mentioned may be used as meta-annotations. That is, it's possible to define a new typing annotation like this:
@JavaType(ThingJavaType.class)
@JdbcTypeCode(JSON)
@Target({METHOD, FIELD})
@Retention(RUNTIME)
public @interface JsonThing {}
The annotation may then be applied to fields and properties of entities and embeddable
objects:
@JsonThing Thing myThing;The packages
org.hibernate.type.descriptor.java and
org.hibernate.type.descriptor.jdbc contain the built-in implementations of
JavaType and JdbcType, respectively.
See the User Guide or the package org.hibernate.type for further
discussion.
Composite types
A composite type is a type which maps to multiple columns. An example of a composite type is an embeddable object, but this is not the only sort of composite type in Hibernate.
A program may implement the CompositeUserType
interface and associate it with a field or property:
- explicitly, using the
@CompositeTypeannotation, or - implicitly, using the
@CompositeTypeRegistrationannotation.
Second level cache
When we make a decision to store an entity in the second-level cache, we must decide much more than just whether "to cache or not to cache". Among other considerations:
- we must assign cache management policies like an expiry timeout, whether to use FIFO-based eviction, whether cached items may be serialized to disk, and
- we must also take great care in specifying how concurrent access to cached items is managed.
In a multi-user system, these policies always depend quite sensitively on the nature of the given entity type, and cannot reasonably be fixed at a more global level.
With all the above considerations in mind, we strongly recommend the use of the
Hibernate-defined annotation Cache to assign
entities to the second-level cache.
The JPA-defined Cacheable annotation is almost useless
to us, since:
- it provides no way to specify any information about the nature of the cached entity and how its cache should be managed, and
- it may not be used to annotate associations.
As an aside, the SharedCacheMode enumeration is even worse:
its only sensible values are NONE and ENABLE_SELECTIVE. The options
ALL and DISABLE_SELECTIVE fit extremely poorly with the practices
advocated above.
Generated values
JPA supports generated identifiers, that is, surrogate primary keys, with four useful built-in types of id generation.
In JPA, an id generator is identified on the basis of a stringly-typed name, and this provides a reasonably natural way to integrate custom generators.
JPA does not define any way to generate the values of other fields or properties of the entity.
Hibernate 6 takes a different route, which is both more typesafe, and much more extensible.
- The interfaces
BeforeExecutionGeneratorandOnExecutionGeneratorprovide an extremely open-ended way to incorporate custom generators. - The meta-annotations
IdGeneratorTypeandValueGenerationTypemay be used to associate a generator with a user-defined annotation. This annotation is an indirection between the generator itself, and the persistent attributes it generates. - This generator annotation may then by used to annotate
@Idattributes,@Versionattributes, and other@Basicattributes to specify how their values are generated.
This package includes a number built-in generator annotations, including
UuidGenerator,
CurrentTimestamp,
TenantId,
Generated, and
GeneratedColumn.
Natural ids
The use of surrogate keys is highly recommended, making it much easier to evolve a database schema over time. But every entity should also have a "natural" unique key: a subset of fields which, taken together, uniquely identify an instance of the entity in the business or scientific domain.
The NaturalId annotation is used to identify
the natural key of an entity, and urge its use.
The NaturalIdCache annotation enables the use
of the second-level cache for when an entity is loaded by natural id. Retrieval
by natural id is a very common thing to do, and so the cache can often be helpful.
Filters
Filters are an extremely powerful feature of Hibernate, allowing the definition of parameterized families of filtered "views" of the domain data. They're also easy to use, with the minor caveat that they require the developer to express filtering expressions in native SQL.
- The
FilterDefannotation defines a named filter, declares its parameters, and might specify a filtering expression used by default. There should be exactly one of these annotations per filter name. - The
Filterannotation is used to identify which entities and associations are affected by the filter, and provide a more specific filtering condition.
Note that a filter has no affect unless it is enabled in a particular session.
Optimistic locking
JPA defines theVersion annotation for optimistic
locking based on an integral version number or Timestamp.
Hibernate allows this annotation to be used with other datetime types including
Instant.
A field may be explicitly excluded from optimistic lock checking using
@OptimisticLock(excluded=true).
This standard JPA approach is the recommended approach when working with a newly-designed database schema. But when working with a legacy database with tables having no version or update timestamp column, an alternative approach is supported:
@OptimisticLocking(ALL)specifies that optimistic lock checking should be done by comparing the values of all columns, and@OptimisticLocking(DIRTY)specifies that optimistic lock checking should be done by checking the values of only the columns which are being set to new values.
For more detail, see OptimisticLocking.
Dialect-specific native SQL
Many annotations in this package allow the specification of native SQL expressions or even complete statements. For example:
Formulaallows a field or property to map to an arbitrary SQL expression instead of a column,Checkspecifies a check constraint condition,ColumnDefaultspecifies a default value, andGeneratedColumnspecifies a generated value,FilterandSQLRestrictioneach specify a restriction written in SQL,SQLOrderspecifies an ordering written in SQL, andSQLSelect,SQLUpdate,SQLInsert, andSQLDeleteallow a whole handwritten SQL statement to be given in place of the SQL generated by Hibernate.
A major disadvantage to annotation-based mappings for programs which target multiple databases is that there can be only one source of metadata which must work on every supported database. Fortunately, there's a—slightly inelegant—solution.
The annotations belonging to DialectOverride allow native
SQL to be overridden for a particular SQL dialect.
For example @DialectOverride.Formula
may be used to customize a @Formula for a given version
of a given database.
-
Interface Summary Interface Description DialectOverride Allows certain annotations to be overridden in a given SQLDialect.SoftDelete.UnspecifiedConversion Used as the default for SoftDelete.converter(), indicating that dialect and settings resolution should be used. -
Class Summary Class Description NoAttributeConverter<O,R> Deprecated. this class is no longer usedQueryHints Deprecated. UseAvailableHintsinstead -
Enum Summary Enum Description CacheConcurrencyStrategy Identifies policies for managing concurrent access to the shared second-level cache.CacheLayout Describes the data layout used for storing an object into the query cache.CacheModeType Deprecated. CascadeType Enumerates the persistence operations which may be cascaded from one entity instance to associated entity instances.FetchMode Enumerates methods for fetching an association from the database.FlushModeType Enumeration extending the JPA flush modes with flush modes specific to Hibernate, and a "null" mode,FlushModeType.PERSISTENCE_CONTEXT, for use as a default annotation value.GenerationTime Deprecated. useEventTypeandEventTypeSetsinsteadLazyCollectionOption Deprecated. Use the JPA-definedFetchType.EAGERinstead ofLazyCollection(FALSE).LazyToOneOption Deprecated. NotFoundAction Specifies how Hibernate should handle the case of an orphaned foreign key with no associated row in the referenced table.OnDeleteAction Enumerates the possible actions for theon deleteclause of a foreign key constraint.OptimisticLockType Enumerates the possible optimistic lock checking strategies.PolymorphismType Deprecated. sincePolymorphismis deprecatedResultCheckStyle Deprecated. Use anExpectationclass instead.SoftDeleteType Enumeration of defines styles of soft-deleteSourceType Specifies the source of a generated value, either the virtual machine, or the database.TimeZoneStorageType Describes the storage of timezone information for zoned datetime types, in particular, for the typesOffsetDateTimeandZonedDateTime.UuidGenerator.Style Represents a kind of UUID, that is, what RFC 4122 calls a "version". -
Annotation Types Summary Annotation Type Description Any Maps a to-one cardinality association taking values over several entity types which are not related by the usual entity inheritance, using a discriminator value stored on the referring side of the relationship.AnyDiscriminator A simplified way to specify the type of the discriminator in anAnymapping, using the JPA-definedDiscriminatorType.AnyDiscriminatorValue Specifies the mapping of a single any-valued discriminator value to its corresponding entity type.AnyDiscriminatorValues List ofAnyDiscriminatorValues.AnyKeyJavaClass Specifies the Java class to use for the foreign key handling related to anAnymapping.AnyKeyJavaType Form ofJavaTypeused to describe the foreign-key part of an ANY mapping.AnyKeyJdbcType AnyKeyJdbcTypeCode Form ofJdbcTypeCodeused to describe the foreign key part of anAnymapping.Array Specifies the maximum length of a SQL array type mapped by the annotated attribute.AttributeAccessor Specifies an attribute access strategy to use.AttributeBinderType Associates a user-defined annotation with anAttributeBinder, allowing the annotation to drive some custom model binding.Bag BatchSize Specifies a maximum batch size for batch fetching of the annotated entity or collection.Cache Marks a root entity or collection for second-level caching, and specifies: a named cache region in which to store the state of instances of the entity or collection, and an appropriate cache concurrency policy, given the expected data access patterns affecting the entity or collection.Cascade Specifies the persistence operations that should cascade to associated entity instances.Check Specifies acheckconstraint to be included in the generated DDL.Checks A list ofChecks.Collate Specifies a collation to use when generating DDL for the column mapped by the annotated field or property.CollectionId Describe an identifier column for a bag.CollectionIdJavaType Form ofJavaTypefor describing the id of an id-bag mapping.CollectionIdJdbcType Form ofJdbcTypefor describing the id of an id-bag mapping.CollectionIdJdbcTypeCode Form ofJdbcTypeCodefor describing the id of an id-bag mapping.CollectionIdMutability Form ofMutabilityfor describing the id of an id-bag mappingCollectionIdType Form ofTypefor describing the id of an id-bag mapping.CollectionType Names a custom collection type for a persistent collection.CollectionTypeRegistration Allows to register aUserCollectionTypeto use as the default for the specified classification of collection.CollectionTypeRegistrations Repeatable container forCollectionTypeRegistrationColumnDefault Specifies that a column has adefaultvalue specified in DDL.Columns Support an array of columns.ColumnTransformer Specifies custom SQL expressions used to read and write to the column mapped by the annotated persistent attribute in all generated SQL involving the annotated persistent attribute.ColumnTransformers Plural annotation for @ColumnTransformer.Comment Specifies a comment that will be included in generated DDL.Comments A list ofComments.CompositeType Specifies a customCompositeUserTypefor the annotated attribute mapping.CompositeTypeRegistration Registers a custom composite user type implementation to be used by default for all references to a particular embeddable class.CompositeTypeRegistrations Grouping ofCompositeTypeRegistrationConcreteProxy AnnotatingConcreteProxyon the root entity class of an inheritance hierarchy will allow types of that hierarchy to always produce proxies that resolve to the concrete subtype class.ConverterRegistration Registers anAttributeConverter.ConverterRegistrations CreationTimestamp Specifies that the annotated field of property is a generated creation timestamp.CurrentTimestamp Specifies that the annotated field of property is a generated timestamp, and also specifies the timing of the timestamp generation, and whether it is generated in Java or by the database:source = VMindicates that the virtual machine current instant is used, andsource = DBindicates that the databasecurrent_timestampfunction should be used.DialectOverride.Check Specializes aCheckin a certain dialect.DialectOverride.Checks DialectOverride.ColumnDefault Specializes aColumnDefaultin a certain dialect.DialectOverride.ColumnDefaults DialectOverride.DiscriminatorFormula Specializes aDiscriminatorFormulain a certain dialect.DialectOverride.DiscriminatorFormulas DialectOverride.FilterDefOverrides DialectOverride.FilterDefs SpecializesFilterDefsin a certain dialect.DialectOverride.FilterOverrides DialectOverride.Filters SpecializesFiltersin a certain dialect.DialectOverride.Formula Specializes aFormulain a certain dialect.DialectOverride.Formulas DialectOverride.GeneratedColumn Specializes aGeneratedColumnin a certain dialect.DialectOverride.GeneratedColumns DialectOverride.JoinFormula Specializes aJoinFormulain a certain dialect.DialectOverride.JoinFormulas DialectOverride.OrderBy Deprecated, for removal: This API element is subject to removal in a future version. DialectOverride.OrderBys DialectOverride.OverridesAnnotation Marks an annotation type as a dialect-specific override for some other annotation type.DialectOverride.SQLDelete Specializes aSQLDeletein a certain dialect.DialectOverride.SQLDeleteAll Specializes aSQLDeleteAllin a certain dialect.DialectOverride.SQLDeleteAlls DialectOverride.SQLDeletes DialectOverride.SQLInsert Specializes aSQLInsertin a certain dialect.DialectOverride.SQLInserts DialectOverride.SQLOrder Specializes anSQLOrderin a certain dialect.DialectOverride.SQLOrders DialectOverride.SQLRestriction Specializes aSQLRestrictionin a certain dialect.DialectOverride.SQLRestrictions DialectOverride.SQLSelect Specializes aSQLSelectin a certain dialect.DialectOverride.SQLSelects DialectOverride.SQLUpdate Specializes aSQLUpdatein a certain dialect.DialectOverride.SQLUpdates DialectOverride.Version Identifies a database version.DialectOverride.Where Deprecated. DialectOverride.Wheres DiscriminatorFormula Specifies an expression written in native SQL as the discriminator for an entity inheritance hierarchy.DiscriminatorOptions Optional annotation used in conjunction with the JPA-definedDiscriminatorColumnannotation to express Hibernate-specific discriminator properties.DynamicInsert Specifies that SQLinsertstatements for the annotated entity are generated dynamically, and only include the columns to which a non-null value must be assigned.DynamicUpdate Specifies that SQLupdatestatements for the annotated entity are generated dynamically, and only include columns which are actually being updated.EmbeddableInstantiator Specifies a custom instantiator for a specific embeddedEmbeddableInstantiatorRegistration Registers a custom instantiator implementation to be used for all references to a particularEmbeddable.EmbeddableInstantiatorRegistrations Grouping ofEmbeddableInstantiatorRegistrationFetch Specifies the default fetching method for the annotated association.FetchProfile Defines a fetch profile, by specifying itsFetchProfile.name(), together with a list of fetch strategy overrides.FetchProfile.FetchOverride Overrides the fetching strategy for a particular association in the named fetch profile being defined.FetchProfileOverride Overrides the fetching strategy for the annotated association in a certain named fetch profile.FetchProfileOverrides A group ofFetchProfileOverrides.FetchProfiles Collects together multiple fetch profiles.Filter Specifies that an entity or collection is affected by a named filter declared using@FilterDef, and allows the default filter condition to be overridden for the annotated entity or collection role.FilterDef Declares a filter, specifying its FilterDef.name(), optionally, a default condition, and its parameter names and types, if it has parameters.FilterDefs Array of filter definitions.FilterJoinTable Specifies that the join table of a collection is affected by a named filter declared usingFilterDef, and allows the default filter condition to be overridden for the annotated entity or collection role.FilterJoinTables Add multiple@FilterJoinTableto a collection.Filters Add multiple@Filters.ForeignKey Deprecated, for removal: This API element is subject to removal in a future version. use the JPA 2.1ForeignKeyannotationFormula Specifies an expression written in native SQL that is used to read the value of an attribute instead of storing the value in aColumn.FractionalSeconds Indicates that the associated temporal value should be stored with fractional seconds.Generated Specifies that the value of the annotated property is generated by the database.GeneratedColumn Specifies that a column is defined using a DDLgenerated always asclause or equivalent, and that Hibernate should fetch the generated value from the database after each SQLINSERTorUPDATE.GeneratorType Deprecated. ValueGenerationTypeandAnnotationValueGenerationnow provide a much more powerful and typesafe alternativeGenericGenerator Deprecated. Use the new approach based onIdGeneratorType.GenericGenerators Deprecated. sinceGenericGeneratoris deprecated.HQLSelect Specifies a custom HQL/JPQL query to be used in place of the default SQL generated by Hibernate when an entity or collection is fetched from the database by id.IdGeneratorType Meta-annotation used to mark another annotation as providing configuration for a custom identifier generator.Immutable Marks an entity, collection, or attribute of an entity as immutable.Imported Marks an arbitrary class as available for use in HQL queries by its unqualified name.Index Deprecated. UseIndexinstead.IndexColumn Deprecated. Instantiator Marks the canonical constructor to be used for instantiation of an embeddable.JavaType Specify an explicitBasicJavaTypeto use for a particular column mapping.JavaTypeRegistration Registers aBasicJavaTypeas the default Java type descriptor for the givenJavaTypeRegistration.javaType().JavaTypeRegistrations Grouping ofJavaTypeRegistrationSee notes onJavaTypeRegistrationabout using on packages versus use on classesJdbcType Specifies an explicitJdbcTypeto use for a particular column mapping. When applied to a Map-valued attribute, describes the Map value.JdbcTypeCode Specifies the JDBC type-code to use for the column mapping. When applied to a Map-valued attribute, describes the Map value.JdbcTypeRegistration JdbcTypeRegistrations Grouping ofJdbcTypeRegistrationSee notes onJdbcTypeRegistrationabout using on packages versus use on classesJoinColumnOrFormula JoinColumnsOrFormulas JoinFormula Specifies a join condition based on an arbitrary native SQL formula instead of a column name.LazyCollection Deprecated. Use the JPA-definedFetchType.EAGERinstead ofLazyCollection(FALSE).LazyGroup Specifies the fetch group for a persistent attribute of an entity class.LazyToOne Deprecated. use JPA annotations to specify theFetchTypeListIndexBase Specifies the base value for theorder columnof a persistent list or array, that is, the order column value of the first element of the list or array.ListIndexJavaType Form ofJavaTypefor describing the column mapping for the index of aListor array.ListIndexJdbcType Form ofJdbcTypefor describing the column mapping for the index of aListor array.ListIndexJdbcTypeCode Form ofJdbcTypeCodefor describing the column mapping for the index of aListor array.Loader Deprecated. ManyToAny Maps a to-many cardinality association taking values over several entity types which are not related by the usual entity inheritance, using a discriminator value stored in an association table.MapKeyCompositeType Form ofCompositeTypefor use with map-keysMapKeyJavaType Form ofJavaTypefor describing the key of a MapMapKeyJdbcType Form ofJdbcTypefor describing the key of a MapMapKeyJdbcTypeCode Form ofJdbcTypeCodefor describing the key of a MapMapKeyMutability Form ofMutabilityfor describing the key of a MapMapKeyType Form ofTypefor use with map keys.Mutability Specifies aMutabilityPlanfor a basic value mapping.NamedNativeQueries A grouping ofNamedNativeQuerydefinitions.NamedNativeQuery Declares a named query written in native SQL.NamedQueries A grouping ofNamedQuerydefinitions.NamedQuery Declares a named query written in HQL or JPQL.Nationalized Specifies that the annotated character data should be stored with nationalization support.NaturalId Specifies that a field or property of an entity class is part of the natural id of the entity.NaturalIdCache Specifies that mappings from the natural id values of the annotated entity to the corresponding entity id values should be cached in the shared second-level cache.NotFound Indicates that a many to one, one to one, or many to many association maps to a column holding foreign keys, but without a foreign key constraint, and which may therefore violate referential integrity.OnDelete Specifies anon deleteaction for a foreign key constraint.OptimisticLock Specifies whether mutating the annotated attribute should trigger an increment to theversionof the entity instance.OptimisticLocking Specifies how optimistic lock checking works for the annotated entity.OrderBy Deprecated, for removal: This API element is subject to removal in a future version. UseSQLOrderinstead.ParamDef Details about a parameter declared in aFilterDef.Parameter Generic parameter (basically a key/value combination) used to parametrize other annotations.Parent Reference the property as a pointer back to the owner (generally the owning entity).PartitionKey Identifies a field of an entity that holds the partition key of a table.Persister Deprecated. Alternative depends on reason for custom persisterPolymorphism Deprecated. This annotation is hardly ever useful.Proxy Deprecated. This annotation is almost never useful.QueryCacheLayout Configures the layout for the entity or collection data in a query cache.RowId Specifies that arowid-like column or pseudo-column should be used as the row locator in CRUD operations for an entity, instead of the primary key of the table.SecondaryRow Specifies how the row of aSecondaryTableshould be managed.SecondaryRows A grouping ofSecondaryRows.SelectBeforeUpdate Deprecated. SinceSession.update(Object)is deprecatedSoftDelete Describes a soft-delete indicator mapping.SortComparator SortNatural Source Deprecated. useCurrentTimestampinsteadSQLDelete Specifies a custom SQL DML statement to be used in place of the default SQL generated by Hibernate when an entity or collection row is deleted from the database.SQLDeleteAll Specifies a custom SQL DML statement to be used in place of the default SQL generated by Hibernate when an entire collection is deleted from the database.SQLDeletes A grouping ofSQLDeletes.SqlFragmentAlias Defines an interpolated alias occurring in a SQL filter condition.SQLInsert Specifies a custom SQL DML statement to be used in place of the default SQL generated by Hibernate when an entity or collection row is inserted in the database.SQLInserts A grouping ofSQLInserts.SQLJoinTableRestriction Specifies a restriction written in native SQL to add to the generated SQL when querying the join table of a collection.SQLOrder Order a collection using an expression or list of expression written in native SQL.SQLRestriction Specifies a restriction written in native SQL to add to the generated SQL for entities or collections.SQLSelect Specifies a custom SQL query to be used in place of the default SQL generated by Hibernate when an entity or collection is loaded from the database by id.SQLUpdate Specifies a custom SQL DML statement to be used in place of the default SQL generated by Hibernate when an entity or collection row is updated in the database.SQLUpdates A grouping ofSQLUpdates.Struct Specifies the UDT (user defined type) name for the annotated embeddable type or embedded attribute.Subselect Maps an immutable and read-only entity to a given SQLselectexpression.Synchronize Specifies a table or tables that hold state mapped by the annotated entity or collection.Table Deprecated, for removal: This API element is subject to removal in a future version. The options available here are all now offered by other newer and better-designed annotations in this package.Tables Deprecated, for removal: This API element is subject to removal in a future version. sinceTableis deprecatedTarget Deprecated. use annotation members of JPA association mapping annotations, for example,OneToMany.targetEntity()TenantId Identifies a field of an entity that holds a tenant id in discriminator-based multitenancy.TimeZoneColumn Specifies the mapped column for storing the time zone information, for use in conjunction withTimeZoneStorageType.COLUMNorTimeZoneStorageType.AUTO.TimeZoneStorage Specifies how the time zone information of a persistent property or field should be persisted.Type Specifies a customUserTypefor the annotated attribute mapping.TypeBinderType Associates a user-defined annotation with aTypeBinder, allowing the annotation to drive some custom model binding.TypeRegistration Registers a custom user type implementation to be used by default for all references to a particular class of basic type.TypeRegistrations Grouping ofTypeRegistrationUpdateTimestamp Specifies that the annotated field of property is a generated update timestamp. The timestamp is regenerated every time an entity instance is updated in the database.UuidGenerator Specifies that an entity identifier is generated as an IETF RFC 4122 UUID.ValueGenerationType Meta-annotation used to mark another annotation as providing configuration for a custom value generation strategy.View Maps an entity to a database view.Where Deprecated. UseSQLRestrictionWhereJoinTable Deprecated.