@Retention(value=RUNTIME) @Target(value=FIELD) public @interface Column
Columnannotation is used for a row class variable, that is equivalent to "@Column" (all defaults are used). Annotates a class variable.
|Modifier and Type||Optional Element and Description|
Specifies how the field associated with this column will be accessed.
Indicates that column is declared as "GENERATED ...
SQL name of column.
Indicates that column is the primary key for row.
Indicates that column is never modified.
Defines class that will read/write row members from/to database.
public abstract java.lang.String name
Field.getName()or is obtained from
NameTranslator.translate(String, Class)if translator is configured for table.
public abstract boolean primaryKey
This must be set to true for all columns needed with
or if update or delete operations are to be performed.
public abstract boolean identity
When identity==true, implies that primaryKey==true so that primaryKey does not need to be specified. Only one identity column is allowed per row class.
Connection.prepareStatement(String, int) will be used to prepare insert
statements to return auto generated keys. Some JDBC drivers do not support auto generated
keys even though the database may allow "GENERATED ... AS IDENTITY ..." in column declaration.
Your driver will report operation not supported or function not supported exceptions if it does
not support auto generated keys.
Connection.prepareStatement(String) will be used to prepare insert statements.
Connection.prepareStatement(String) is supported by most JDBC drivers.
public abstract boolean readOnly
public abstract java.lang.Class<? extends ColumnTranslator> translator
Database.initTypeTranslatorMap()for default translators.
public abstract FieldAccessType fieldAccess
FieldAccessType.Method to read/write the field value with getter/setter. Public
getter/setter methods are required.
FieldAccessType.Direct to read/write the field value with direct access
Field.set(Object, Object). No getter/setter are required.