我刚开始使用 greenDao,但我无法初始化 DaoGenerator:调用new DaoGenerator();
会引发异常
de.greenrobot.daogenerator.DaoGenerator.(DaoGenerator.java:60) 处的 java.lang.ExceptionInInitializerError
这是我的代码:
Schema schema = new Schema(1,"com.emt.testdb.greendao");
schema.setDefaultJavaPackageTest("com.emt.testdb.greendao.test");
schema.setDefaultJavaPackageDao("com.emt.testdb.greendao.dao");
Entity user = schema.addEntity("User");
user.addIdProperty();
user.addStringProperty("name");
user.addStringProperty("password");
user.addIntProperty("yearOfBirth");
DaoGenerator daoGenerator = null;
try
{
daoGenerator = new DaoGenerator();
// daoGenerator.generateAll(schema, "../project/src-gen");
} catch (IOException e)
{
e.printStackTrace();
}
catch (Exception e)
{
e.printStackTrace();
}
非常感谢您的帮助!