greenDAO icon indicating copy to clipboard operation
greenDAO copied to clipboard

help me god.....error~

Open amsterly opened this issue 11 years ago • 1 comments

i used : Entity substanceEntitiy = schema.addEntity("Substances");// 表名 substanceEntitiy.setTableName("Substances"); // 可以对表重命名 substanceEntitiy.addIdProperty(); substanceEntitiy.addStringProperty("Name").notNull();// 主键,索引 de.greenrobot.daogenerator.Property typeProperty= substanceEntitiy.addLongProperty("Type").notNull().getProperty();// 主键,索引 substanceEntitiy.addStringProperty("MatchTimes").notNull(); substanceEntitiy.addBooleanProperty("Shield").notNull();// 主键,索引

    Entity substancesCategory = schema.addEntity("SubstancesCategory");// 表名
    substancesCategory.setTableName("SubstancesCategory"); // 可以对表重命名
    substancesCategory.addIdProperty().getProperty();
    substancesCategory.addStringProperty("Name").notNull();// 主键,索引
    substancesCategory.addStringProperty("Remark");

i got this eror: 09-22 18:05:26.856 3956-3956/? E/AndroidRuntime﹕ FATAL EXCEPTION: main de.greenrobot.dao.DaoException: Entity is detached from DAO context at model.Substances.getSubstancesCategory(Substances.java:103) at greendaotest.example.com.greendaotest.CommonAdapter.MyAdapterWithCommonHolder.convert(MyAdapterWithCommonHolder.java:30) at greendaotest.example.com.greendaotest.CommonAdapter.MyAdapterWithCommonHolder.convert(MyAdapterWithCommonHolder.java:17)

could u help me?

amsterly avatar Sep 22 '15 10:09 amsterly

Based on the given information we cannot help you.

greenrobot avatar Nov 06 '15 20:11 greenrobot