@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface Column
The class containing the annotated field must be annotated by @Table.
An annotated field can also be annotated by @Index.
SQLite-compatible types include boolean, byte, byte[],
double, float, int, long, short
and String. If the type of the annotated field is not SQLite-compatible,
a TypeConverter is required for type conversion. Use <@UseConverter
to indicate the TypeConverter to use for the annotated field.
Table,
Index,
UseConverter| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
autoIncrement
true if the primary key column is also an auto-increment column,
otherwise, false. |
boolean |
nullable
true if the column can be null; otherwise, false. |
boolean |
primaryKey
true if the column is a primary key; otherwise, false. |
java.lang.String |
value
The name of the table name.
|
public abstract java.lang.String value
If not specified, the name in exact case of the annotated field will be used.
public abstract boolean nullable
true if the column can be null; otherwise, false.
nullable is ignored if primaryKey is true.
public abstract boolean primaryKey
true if the column is a primary key; otherwise, false.
Only one column within a table can be defined as primary key.
public abstract boolean autoIncrement
true if the primary key column is also an auto-increment column,
otherwise, false.
autoIncrement is ignored if primaryKey is not set to true.