ColumnInfo

public abstract @interface ColumnInfo
implements Annotation

androidx.room.ColumnInfo


Allows specific customization about the column associated with this field.

For example, you can specify a column name for the field or change the column's type affinity.

Summary

Nested classes

@interface ColumnInfo.Collate

 

@interface ColumnInfo.SQLiteTypeAffinity

The SQLite column type constants that can be used in ColumnInfo.typeAffinity()  

Constants

int BINARY

Collation sequence for case-sensitive match.

int BLOB

Column affinity constant for binary data.

String INHERIT_FIELD_NAME

Constant to let Room inherit the field name as the column name.

int INTEGER

Column affinity constant for integers or booleans.

int LOCALIZED

Collation sequence that uses system's current locale.

int NOCASE

Collation sequence for case-insensitive match.

int REAL

Column affinity constant for floats or doubles.

int RTRIM

Collation sequence for case-sensitive match except that trailing space characters are ignored.

int TEXT

Column affinity constant for strings.

int UNDEFINED

Undefined type affinity.

int UNICODE

Collation sequence that uses Unicode Collation Algorithm.

int UNSPECIFIED

Collation sequence is not specified.

String VALUE_UNSPECIFIED

A constant for defaultValue() that makes the column to have no default value.

Public methods

int collate()

The collation sequence for the column, which will be used when constructing the database.

String defaultValue()

The default value for this column.

boolean index()

Convenience method