@Retention(value=RUNTIME)
@Target(value=FIELD)
@Inherited
public @interface KITTY_COLUMN
TypeAffinities.INTEGER
as affinity in columnAffinity() without PRIMARY_KEY.autoincrement()
flag and without AscDesc.DESCENDING as value for PRIMARY_KEY.orderAscDesc(), cause:
KITTY_COLUMN set isIPK() to true and columnAffinity() to
TypeAffinities.INTEGER or
KITTY_COLUMN @link KITTY_COLUMN#columnAffinity()} to TypeAffinities.INTEGER and
annotate model's field with PRIMARY_KEY without setting PRIMARY_KEY.autoincrement() and
PRIMARY_KEY.orderAscDesc() to value AscDesc.DESCENDING. Also do not forget to annotate field with
NOT_NULL (SQLite supports NULL values for IPK but they not supported by KittyORM).
| Modifier and Type | Required Element and Description |
|---|---|
int |
columnOrder
Returns field order
|
| Modifier and Type | Optional Element and Description |
|---|---|
TypeAffinities |
columnAffinity
Returns associated with this variable column type of sql table
|
java.lang.String |
columnName
Returns associated with this variable column name of sql table
|
boolean |
isIPK
Returns if this field should be used as simple tableIndex column for this table
If true than resulting column would automatically get two constraints: NOT_NULL @NOT_NULL
PRIMARY_KEY @PRIMARY_KEY{orderAscDesc = ASCENDING}
This would result in something like 'COLNAME INTEGER NOT NULL PRIMARY KEY ASC' Also, notice that this would rewrite columnAffinity() to INTEGER and
any NOT_NULL and PRIMARY_KEY would be skipped. |
boolean |
isValueGeneratedOnInsert
Returns true if this field is part of primary key and this value should be generated on databaseClass insert
What is idea of this field? |
public abstract java.lang.String columnName
public abstract TypeAffinities columnAffinity
public abstract boolean isValueGeneratedOnInsert
KittyMapper.save(KittyModel) method should understand what operation
on model should be performed, insert or update. Firstly this method checks availability of rowid, if mapper has
rowid support turned off or table was created with WITHOUT ROWID, than method would try to check all columns of primary
key and fields of model that represents table on NULL values.
public abstract boolean isIPK
NOT_NULL @NOT_NULL
PRIMARY_KEY @PRIMARY_KEY{orderAscDesc = ASCENDING}
columnAffinity() to INTEGER and
any NOT_NULL and PRIMARY_KEY would be skipped.
Long type in order that KittyMapper
would process KittyMapper.save(KittyModel) operation effectively