0
我將嘗試使用下面的代碼... 我使用的枚舉類是枚舉類型轉換成int
public enum AccountType {
kAccountTypeAsset(0x1000),
kAccountTypeAssetFixed(0x1010),
private int value;
private AccountType(int value)
{
this.value = value;
}
public int getValue()
{
return value;
}
}
public AccountType accountType = kAccountTypeAsset;
integerToDB(accountType);
...
/*************************/
public Object integerToDB (Integer i)
{
if(i == -1)
{
return null;
}
return i;
}
如何使用
ACCOUNTTYPE
作爲整數。
是不是你的getValue()方法是什麼? – 2012-02-03 05:38:55