Back to project page guerrillaprose.
The source code is released under:
GNU General Public License
If you think the Android project guerrillaprose 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 de.handler.mobile.android.bachelorapp.app.database; /*from ww w . j a v a 2 s . c o m*/ import android.os.Parcel; import android.os.Parcelable; 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 MEDIA_TYPE. */ public class MediaType implements android.os.Parcelable { private Long id; /** Not-null value. */ private String media_type; /** Used to resolve relations */ private transient DaoSession daoSession; /** Used for active entity operations. */ private transient MediaTypeDao myDao; private List<Media> mediaList; // KEEP FIELDS - put your custom fields here // KEEP FIELDS END public MediaType() { } public MediaType(Long id) { this.id = id; } public MediaType(Long id, String media_type) { this.id = id; this.media_type = media_type; } /** called by internal mechanisms, do not call yourself. */ public void __setDaoSession(DaoSession daoSession) { this.daoSession = daoSession; myDao = daoSession != null ? daoSession.getMediaTypeDao() : null; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } /** Not-null value. */ public String getMedia_type() { return media_type; } /** Not-null value; ensure this value is available before it is saved to the database. */ public void setMedia_type(String media_type) { this.media_type = media_type; } /** 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<Media> getMediaList() { if (mediaList == null) { if (daoSession == null) { throw new DaoException("Entity is detached from DAO context"); } MediaDao targetDao = daoSession.getMediaDao(); List<Media> mediaListNew = targetDao._queryMediaType_MediaList(id); synchronized (this) { if(mediaList == null) { mediaList = mediaListNew; } } } return mediaList; } /** Resets a to-many relationship, making the next get call to query for a fresh result. */ public synchronized void resetMediaList() { mediaList = null; } public void delete() { if (myDao == null) { throw new DaoException("Entity is detached from DAO context"); } myDao.delete(this); } public void update() { if (myDao == null) { throw new DaoException("Entity is detached from DAO context"); } myDao.update(this); } 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 public MediaType(Parcel in) { id = in.readLong(); media_type = in.readString(); } public MediaType(String type) { this.media_type = type; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { try { dest.writeLong(id); dest.writeString(media_type); } catch (NullPointerException e) { e.printStackTrace(); } } public static final Parcelable.Creator<MediaType> CREATOR = new Parcelable.Creator<MediaType>() { public MediaType createFromParcel(Parcel in) { return new MediaType(in); } public MediaType[] newArray(int size) { return new MediaType[size]; } }; // KEEP METHODS END }