Skip to content

@BindSqlColumn

xcesco edited this page May 5, 2018 · 1 revision

This annotation allows customizing binding from Java bean's field to SQLite table's columns.

Attributes

  • columnType: specify if column is a PRIMARY_KEY, UNIQUE, or STANDARD. The default value is STANDARD.
  • enabled: if false means that associated field is not bonded to SQLite database table. The default value is true.
  • parentEntity: link to entity/class linked by this field if it is a foreign key. It can be used only on long/Long column type.
  • nullable: if true, column can be set to null. The default value is true.
  • onDelete: Action to take on foreign key constraint during a DELETE operation. It's used only if foreignKey is defined.
  • onUpdate: Action to take on foreign key constraint during an UPDATE operation. It's used only if foreignKey is defined.
  • value: name of the column. If not present, the column name is the field name. It must be specified in java style naming conventions.

Usage

Just an example:

@BindType
public class User {

  @BindColumn(columnType=ColumnType.PRIMARY_KEY)
  public long id;
	
  @Bind(enabled=false)
  public int index;
  
  @BindColumn("picture")
  public String pictureUrl;
}

Table of Contents

Query definition

Features

Relations

Multithread supports

Modularization

Annotations for data convertion

Annotations for SQLite ORM

Annotations for shared preferences

Clone this wiki locally