CHAPTER 6 (Top ten web hosting) n MAPPING WITH ANNOTATIONS n MAPPING
Monday, April 16th, 2007CHAPTER 6 n MAPPING WITH ANNOTATIONS n MAPPING WITH ANNOTATIONS Table 6-1. Continued Attribute Name Target Purpose FieldResult Pm Used as a parameter of the @SqlResultSetMapping annotation, permits the fields of an entity to be returned as columns in a conventional JDBC ResultSet. 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 forming the primary key will be marked with the @Id attribute. Inheritance T Marks an entity as being the root of an entity inheritance 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 limitations 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 association 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/ NamedNativeQueries Pk and T Allows a named SQL query to be stored in the 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.
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision virtual web hosting services