Java Reference
In-Depth Information
Attribute Name
Target
Purpose
PersistenceContext /
T, M, and F
For use with @EntityManager ; marks a field or
PersistenceContexts
property as representing the EntityManager to be
injected by the container.
PersistenceUnit /
For use with @EntityManager ; marks a field or
T, M, and F
PersistenceUnits
property as representing the EntityManagerFactory
to be injected by the container.
PostLoad
M
Marks a method for invocation after performing a
load operation on the entity.
PostPersist
M
Marks a method for invocation after performing a
persist operation on the entity.
PostRemove
M
Marks a method for invocation after performing a
remove operation on the entity.
PostUpdate
M
Marks a method for invocation after performing an
update operation on the entity.
PrePersist
M
Marks a method for invocation prior to performing
a persist operation on the entity.
PreRemove
M
Marks a method for invocation prior to performing
a remove operation on the entity.
PreUpdate
M
Marks a method for invocation prior to performing
an update operation on the entity.
PrimaryKeyJoinColumn /
T, M, and F
Allows the columns joining a secondary table to a
PrimaryKeyJoinColumns
primary table to be specified.
QueryHint
Pm
Allows implementation-specific “hints” to be pro-
vided as a parameter of named queries and named
native queries.
SecondaryTable /
T
Allows an entity's basic fields and properties to be
SecondaryTables
persisted to more than one table.
SequenceGenerator
Pk, T, M, and F
Allows a named primary key generator to be
defined for use by one or more entities.
SqlResultSetMapping
Pk and T
Allows an entity to be mapped as if it were a named
native query (i.e., so that it can be retrieved as a
conventional JDBC ResultSet ).
Table
T
Pk, T, M, and F
Allows the default details of an entity's primary
table to be overridden.
TableGenerator
Pk, T, M, and F
Overrides the default properties of the table used to
generate primary keys when the table generation
strategy of the generated value annotation is used
on the primary key field or property (the field or
property marked with the @Id annotation).
Temporal
Specifies the behavior of Date and Calendar fields or
properties (if omitted, such fields will be treated as
TIMESTAMP values).
M and F
Transient
M and F
Allows a field or property to be marked so that it
will not be persisted.
UniqueConstraint
Pm
Enforces a unique constraint at schema generation
time as a parameter of @Table .
Version
M and F
Marks the field or property serving as the optimistic
lock value of the entity.
Key to the Target column: Pk = package, T = type, M = method, F = field, Pm = parameter
Search WWH ::




Custom Search