package de.luhmer.owncloudnewsreader.database.model; import java.util.List; import de.greenrobot.dao.DaoException; // THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS // KEEP INCLUDES - put your custom includes here // KEEP INCLUDES END /** * Entity mapped to table "FOLDER". */ public class Folder { private long id; /** Not-null value. */ private String label; /** Used to resolve relations */ private transient DaoSession daoSession; /** Used for active entity operations. */ private transient FolderDao myDao; private List<Feed> feedList; // KEEP FIELDS - put your custom fields here // KEEP FIELDS END public Folder() { } public Folder(long id) { this.id = id; } public Folder(long id, String label) { this.id = id; this.label = label; } /** called by internal mechanisms, do not call yourself. */ public void __setDaoSession(DaoSession daoSession) { this.daoSession = daoSession; myDao = daoSession != null ? daoSession.getFolderDao() : null; } public long getId() { return id; } public void setId(long id) { this.id = id; } /** Not-null value. */ public String getLabel() { return label; } /** Not-null value; ensure this value is available before it is saved to the database. */ public void setLabel(String label) { this.label = label; } /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */ public List<Feed> getFeedList() { if (feedList == null) { if (daoSession == null) { throw new DaoException("Entity is detached from DAO context"); } FeedDao targetDao = daoSession.getFeedDao(); List<Feed> feedListNew = targetDao._queryFolder_FeedList(id); synchronized (this) { if(feedList == null) { feedList = feedListNew; } } } return feedList; } /** Resets a to-many relationship, making the next get call to query for a fresh result. */ public synchronized void resetFeedList() { feedList = null; } /** Convenient call for {@link AbstractDao#delete(Object)}. Entity must attached to an entity context. */ public void delete() { if (myDao == null) { throw new DaoException("Entity is detached from DAO context"); } myDao.delete(this); } /** Convenient call for {@link AbstractDao#update(Object)}. Entity must attached to an entity context. */ public void update() { if (myDao == null) { throw new DaoException("Entity is detached from DAO context"); } myDao.update(this); } /** Convenient call for {@link AbstractDao#refresh(Object)}. Entity must attached to an entity context. */ public void refresh() { if (myDao == null) { throw new DaoException("Entity is detached from DAO context"); } myDao.refresh(this); } // KEEP METHODS - put your custom methods here // KEEP METHODS END }