-
Notifications
You must be signed in to change notification settings - Fork 24
Define table
hamsterksu edited this page Oct 23, 2014
·
1 revision
Use tipical annotations to define table. You can use @PrimaryKey, @Autoincrement, @NotNull, @Unique annotation to define column. Also you can add @Index or @PrimaryKey by few columns for table.
To allow access to the table over content provider use @URI to mark content path
@Table(TeamTable.TABLE_NAME)
public static interface TeamTable{
String TABLE_NAME = "team_table";
@URI
String CONTENT_URI = "team_table";
@PrimaryKey
@Column(type = Type.INTEGER)
String ID = "_id";
@Column(type = Type.TEXT)
String TITLE = "title";
@Column(type = Type.INTEGER)
String CHEMP_ID = "chemp_id";
}