greenrobot / greenDAO

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.
http://greenrobot.org/greendao/
12.63k stars 2.89k forks source link

May be a bug like #101 #1030

Open fmliqi opened 4 years ago

fmliqi commented 4 years ago
class Recipe {
   private String stepContent;
    @ToMany(referencedJoinProperty = "recipeId")
    private List<FoodMaterial> foodMaterialList;

   @Generated(hash = 1718473014)
    public List<FoodMaterial> getFoodMaterialList() {
        if (foodMaterialList == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            FoodMaterialDao targetDao = daoSession.getFoodMaterialDao();
            List<FoodMaterial> foodMaterialListNew = targetDao
                    ._queryRecipe_FoodMaterialList(id);
            synchronized (this) {
                if (foodMaterialList == null) {
                    foodMaterialList = foodMaterialListNew;
                }
            }
        }
        return foodMaterialList;
    }

}