|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=FIELD) public @interface Column
Defines column attributes for a row class variable. If no Column
annotaion is
used for a row class variable, that is equivalent to "@Column" (all defaults are used).
Annotates a class variable.
Optional Element Summary | |
---|---|
boolean |
identity
Indicates that column is declared as "GENERATED ... |
java.lang.String |
name
SQL name of column. |
boolean |
primaryKey
Indicates that column is the primary key for row. |
java.lang.Class<? extends ColumnTranslator> |
translator
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 Table.select(Object...)
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.
If true, 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.
If false, Connection.prepareStatement(String)
will be used to prepare insert statements.
Connection.prepareStatement(String)
is supported by most JDBC drivers.
Statement.getGeneratedKeys()
public abstract java.lang.Class<? extends ColumnTranslator> translator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |