![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Describes the basic annotation for a single-table entity bean.
Annotates the class as an entity bean. See the basic property tutorial and the basic field tutorial for an introduction. name | The name of the bean | The class name (unqualified)
| The fields or properties will be annotated by @Id, @Basic, etc. Amber will detect either field or property annotation by the type for the @Id. In other words, if Amber sees an @Id on a field, it will use field access. If Amber sees @Id on a method, it will use property access. Specifies a secondary database table for an entity bean. The secondary table will contain the fields with a secondaryTable in the @Column. name | The name of the table | The unqualified class name.
| catalog | the table's catalog | none
| schema | the table's schema | none
| pkJoinColumns | join column to the primary table | joins the primary key
| uniqueConstraint | unique constraints during generation | none
| Specifies the database table for an entity bean. The default table name is the class name. name | The name of the table | The unqualified class name.
| catalog | the table's catalog | none
| schema | the table's schema | none
| uniqueConstraint | unique constraints during generation | none
| Marks a field as a persistent field. fetch | EAGER or LAZY fetching | FetchType.EAGER
| optional | if true, the column may be null | true
| The fetch types are:
Specifies the field's SQL column name as well as any CREATE TABLE properties for auto generation. name | The SQL name of the column | the field name
| unique | True for UNIQUE columns | false
| nullable | False for IS NOT NULL columns | true
| insertable | True if column is inserted on a | create calltrue
| updatable | True if column is updated when the field is modified | false
| columnDefinition | SQL to create the column in a CREATE TABLE | none
| table | specified if column is stored in a secondary table | none
| length | the default length for a VARCHAR for a CREATE TABLE | 255
| precision | the default length for a number definition for a CREATE TABLE | 0
| scale | the default length for a number definition for a CREATE TABLE | 0
| Marks a field as a primary key. The The default column name is "ID". Used with @Id to specify a generator for automatic key generation when new objects are created. strategy | The auto-generation type | AUTO
| generator | The sequence or table generator name | ${table}_cseq
| The generator types are:
For SEQUENCE and TABLE, Resin will create the sequence name as "${table}_cseq". Defines an association table for a many-to-many relation. name | Table definition for the association table | concatening the source and target table names
| catalog | Database catalog | ""
| schema | Database schema | ""
| joinColumns | Columns from from the association table to the source table | Uses the source table primary key
| inverseJoinColumns | Columns from from the association table to the target table | Uses the target table primary key
| Defines a join (foreign) columns. Used for @ManyToOne. See also @Column for corresponding definition for @Basic columns. See the Many-to-One tutorial for a full example. name | The column name of the source table | the column name of the target key
| referencedColumnName | The target column for composite keys | the single primary key
| unique | True if unique | false
| nullable | False if IS NOT NULL | true
| insertable | True if the column is inserted on a | createtrue
| updateable | True if the column is updated on field changes | true
| columnDefinition | SQL column definition | false
| table | specifies a secondary table if not in the primary | none
| Defines a set of join (foreign) columns for composite keys. Marks a field as a many-to-many (association) relation. The column names are the key columns of the source and target tables. See the many-to-many tutorial for an example. targetEntity | The class of the target entity | the property's type
| cascade | Operations which cascade to the target | none
| fetch | EAGER or LAZY fetching | FetchType.EAGER
| mappedBy | Specifies the source relation if a target |
| Marks a field as a many-to-one (link) relation. The default column name is the column name of the target key. See the many-to-one tutorial for an example. targetEntity | The class of the target entity | the property's type
| cascade | Operations which cascade to the target | none
| fetch | EAGER or LAZY fetching | FetchType.EAGER
| optional | If false, the relation must always have a value | true
| Marks a field as a one-to-many (collection) relation. Because a one-to-many field is dependent, it needs a @ManyToOne relation on the source table which defines the column. targetEntity | The class of the target entity | the property's type
| cascade | Operations which cascade to the target | none
| fetch | EAGER or LAZY fetching | FetchType.EAGER
| mappedBy | Specifies the owning @ManyToOne property |
| Marks a field as a one-to-one (dependent link) relation. Because a one-to-one field is dependent, it needs a @ManyToOne relation on the source table which defines the column. targetEntity | The class of the target entity | the property's type
| cascade | Operations which cascade to the target | none
| fetch | EAGER or LAZY fetching | FetchType.EAGER
| mappedBy | Specifies the owning relation |
| Configures the discriminator column. @Inheritance marks the entity bean as supporting inheritance, i.e. the database maps to different Java classes depending on a discriminator value.
Copyright (c) 1998-2009 Caucho Technology, Inc. All rights reserved. caucho® , resin® and quercus® are registered trademarks of Caucho Technology, Inc. |