Back to project page intelligent-lock-pattern.
The source code is released under:
GNU General Public License
If you think the Android project intelligent-lock-pattern listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.unioeste.ilp.models; /*from w w w.j a va 2 s .c o m*/ import java.util.List; import org.unioeste.ilp.models.DaoSession; import de.greenrobot.dao.DaoException; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit. /** * Entity mapped to table attempts. */ public class Attempt { private Long id; private Long experience_id; /** Used to resolve relations */ private transient DaoSession daoSession; /** Used for active entity operations. */ private transient AttemptDao myDao; private Experience experience; private Long experience__resolvedKey; private List<Sample> samples; public Attempt() { } public Attempt(Long id) { this.id = id; } public Attempt(Long id, Long experience_id) { this.id = id; this.experience_id = experience_id; } /** called by internal mechanisms, do not call yourself. */ public void __setDaoSession(DaoSession daoSession) { this.daoSession = daoSession; myDao = daoSession != null ? daoSession.getAttemptDao() : null; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getExperience_id() { return experience_id; } public void setExperience_id(Long experience_id) { this.experience_id = experience_id; } /** To-one relationship, resolved on first access. */ public Experience getExperience() { if (experience__resolvedKey == null || !experience__resolvedKey.equals(experience_id)) { if (daoSession == null) { throw new DaoException("Entity is detached from DAO context"); } ExperienceDao targetDao = daoSession.getExperienceDao(); experience = targetDao.load(experience_id); experience__resolvedKey = experience_id; } return experience; } public void setExperience(Experience experience) { this.experience = experience; experience_id = experience == null ? null : experience.getId(); experience__resolvedKey = experience_id; } /** 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 synchronized List<Sample> getSamples() { if (samples == null) { if (daoSession == null) { throw new DaoException("Entity is detached from DAO context"); } SampleDao targetDao = daoSession.getSampleDao(); samples = targetDao._queryAttempt_Samples(id); } return samples; } /** Resets a to-many relationship, making the next get call to query for a fresh result. */ public synchronized void resetSamples() { samples = 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); } }