我在将对象插入 SQLite 数据库时遇到问题。我的课,Case
看起来像这样:
public class Case {
String caseNumber;
int status;
String date;
Bitmap rightIndexFinger;
Bitmap leftIndexFinger;
public Case(String caseNumber, int status, String date, Bitmap rightIndexFinger, Bitmap leftIndexFinger) {
this.caseNumber = caseNumber;
this.status = status;
this.date = date;
this.rightIndexFinger = rightIndexFinger;
this.leftIndexFinger = leftIndexFinger;
}
public Case(String caseNumber, int status, String date) {
this.caseNumber = caseNumber;
this.status = status;
this.date = date;
}
public Bitmap getRightIndexFinger() {
return rightIndexFinger;
}
public void setRightIndexFinger(Bitmap rightIndexFinger) {
this.rightIndexFinger = rightIndexFinger;
}
public Bitmap getLeftIndexFinger() {
return leftIndexFinger;
}
public void setLeftIndexFinger(Bitmap leftIndexFinger) {
this.leftIndexFinger = leftIndexFinger;
}
public String getCaseNumber() {
return caseNumber;
}
public void setCaseNumber(String caseNumber) {
this.caseNumber = caseNumber;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getDate() {
return date.toString();
}
public void setDate(String date) {
this.date = date;
}
}
我需要将此类的对象插入 SQLite 数据库。我尝试的是:
String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_CASES + "("
+ KEY_ID + " INTEGER PRIMARY KEY," + DATE + " TEXT,"
+ RIGHTFINGER + " TEXT," + LEFTFINGER +" TEXT" + ")";
db.execSQL(CREATE_CONTACTS_TABLE);
case
如果类中的所有变量都是 ,这是有道理的String
,但是如何为位图做到这一点?