Last active
November 23, 2015 23:12
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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