Skip to content

Instantly share code, notes, and snippets.

@jy2k
Last active November 23, 2015 23:12
Show Gist options
  • Save jy2k/53efee4a57f1a8c383e5 to your computer and use it in GitHub Desktop.
Save jy2k/53efee4a57f1a8c383e5 to your computer and use it in GitHub Desktop.
If you're having a hard time creating the SoldierDBItem look at the following code (Try not to straight out copy)
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
@DatabaseTable(tableName = SoldierDBItem.TABLE_NAME)
public class SoldierDBItem {
public static final String TABLE_NAME = "soldiers";
//
public static final String COLUMN_ID = "id";
public static final String COLUMN_NAME = "name";
public static final String COLUMN_AGE = "age";
@DatabaseField(generatedId = true, columnName = COLUMN_ID)
public long mId;
@DatabaseField(columnName = COLUMN_NAME)
public String mName;
@DatabaseField(columnName = COLUMN_AGE)
public int mAge;
public SoldierDBItem() {
// required by ORMLite
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment