Java Reference
In-Depth Information
Table 6-1. Continued
Attribute Name
Target
Purpose
FieldResult
Used as a parameter of the @SqlResultSetMapping
annotation, permits the fields of an entity to be
returned as columns in a conventional JDBC
ResultSet .
Pm
GeneratedValue
M and F
Allows generation strategies to be specified for the
marked entity's primary key value(s).
Id
M and F
Identifies the primary key of the entity. Placement
of the @Id attribute also determines whether the
default access mode for the entity class is field or
property access.
IdClass
T
Applied to indicate that an entity's primary key is
represented with columns corresponding to the
fields of another entity. The appropriate fields form-
ing the primary key will be marked with the @Id
attribute.
Inheritance
T
Marks an entity as being the root of an entity inher-
itance hierarchy (i.e., the highest persistent class in
the class inheritance hierarchy).
JoinColumn / JoinColumns
T, M, and F
Defines the column(s) being used as a foreign key
into another table.
JoinTable
M and F
Allows the details of the link table to be specified in
a one-to-many or many-to-many relationship.
Lob
M and F
Marks a field or property as being stored as a large
object data type—typically a binary large object
(BLOB). This can be used to remove the length limi-
tations on strings and binary data, but usually
implies reduced scope for querying the data so
marked.
ManyToMany
M and F
Allows a many-to-many association to be defined
between entities.
ManyToOne
M and F
Allows a many-to-one association to be defined
between entities.
MapKey
M and F
Allows a key to be specified when making an associ-
ation with a Map object.
MappedSuperclass
T
Allows a non-persistence class to be used as the
basis of the mapping information for its derived
classes.
NamedNativeQuery /
Pk and T
Allows a named SQL query to be stored in the
NamedNativeQueries
annotations.
NamedQuery / NamedQueries
Pk and T
Allows a named EJB QL query to be stored in the
annotations.
OneToMany
M and F
Allows a one-to-many association to be defined
between entities.
OneToOne
M and F
Allows a one-to-one association to be defined
between entities.
OrderBy
MF
Allows the ordering of a collection to be defined as
it is retrieved.
Search WWH ::




Custom Search