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; /* w w w . jav a 2s . c o m*/ import android.os.Parcel; import android.os.Parcelable; 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 GUERRILLA_PROSE. */ public class GuerrillaProse implements android.os.Parcelable { private Long id; private Long remote_id; /** Not-null value. */ private String title; /** Not-null value. */ private String text; /** Not-null value. */ private String tag; private Boolean shared; private Long remote_media_id; private String author; private Long user_id; private Long media_id; /** Used to resolve relations */ private transient DaoSession daoSession; /** Used for active entity operations. */ private transient GuerrillaProseDao myDao; private Guerrilla guerrilla; private Long guerrilla__resolvedKey; private Media media; private Long media__resolvedKey; // KEEP FIELDS - put your custom fields here // KEEP FIELDS END public GuerrillaProse() { } public GuerrillaProse(Long id) { this.id = id; } public GuerrillaProse(Long id, Long remote_id, String title, String text, String tag, Boolean shared, Long remote_media_id, String author, Long user_id, Long media_id) { this.id = id; this.remote_id = remote_id; this.title = title; this.text = text; this.tag = tag; this.shared = shared; this.remote_media_id = remote_media_id; this.author = author; this.user_id = user_id; this.media_id = media_id; } /** called by internal mechanisms, do not call yourself. */ public void __setDaoSession(DaoSession daoSession) { this.daoSession = daoSession; myDao = daoSession != null ? daoSession.getGuerrillaProseDao() : null; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getRemote_id() { return remote_id; } public void setRemote_id(Long remote_id) { this.remote_id = remote_id; } /** Not-null value. */ public String getTitle() { return title; } /** Not-null value; ensure this value is available before it is saved to the database. */ public void setTitle(String title) { this.title = title; } /** Not-null value. */ public String getText() { return text; } /** Not-null value; ensure this value is available before it is saved to the database. */ public void setText(String text) { this.text = text; } /** Not-null value. */ public String getTag() { return tag; } /** Not-null value; ensure this value is available before it is saved to the database. */ public void setTag(String tag) { this.tag = tag; } public Boolean getShared() { return shared; } public void setShared(Boolean shared) { this.shared = shared; } public Long getRemote_media_id() { return remote_media_id; } public void setRemote_media_id(Long remote_media_id) { this.remote_media_id = remote_media_id; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public Long getUser_id() { return user_id; } public void setUser_id(Long user_id) { this.user_id = user_id; } public Long getMedia_id() { return media_id; } public void setMedia_id(Long media_id) { this.media_id = media_id; } /** To-one relationship, resolved on first access. */ public Guerrilla getGuerrilla() { Long __key = this.user_id; if (guerrilla__resolvedKey == null || !guerrilla__resolvedKey.equals(__key)) { if (daoSession == null) { throw new DaoException("Entity is detached from DAO context"); } GuerrillaDao targetDao = daoSession.getGuerrillaDao(); Guerrilla guerrillaNew = targetDao.load(__key); synchronized (this) { guerrilla = guerrillaNew; guerrilla__resolvedKey = __key; } } return guerrilla; } public void setGuerrilla(Guerrilla guerrilla) { synchronized (this) { this.guerrilla = guerrilla; user_id = guerrilla == null ? null : guerrilla.getId(); guerrilla__resolvedKey = user_id; } } /** To-one relationship, resolved on first access. */ public Media getMedia() { Long __key = this.media_id; if (media__resolvedKey == null || !media__resolvedKey.equals(__key)) { if (daoSession == null) { throw new DaoException("Entity is detached from DAO context"); } MediaDao targetDao = daoSession.getMediaDao(); Media mediaNew = targetDao.load(__key); synchronized (this) { media = mediaNew; media__resolvedKey = __key; } } return media; } public void setMedia(Media media) { synchronized (this) { this.media = media; media_id = media == null ? null : media.getId(); media__resolvedKey = media_id; } } 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 // Unmarshalling public GuerrillaProse(Parcel in) { id = in.readLong(); remote_id = in.readLong(); title = in.readString(); text = in.readString(); tag = in.readString(); shared = in.readByte() != 0; remote_media_id = in.readLong(); author = in.readString(); user_id = in.readLong(); media_id = in.readLong(); } public GuerrillaProse(String title, String text, String tag, Boolean shared, java.util.Date date, Long userId, Long mediaId) { this.title = title; this.text = text; this.tag = tag; this.shared = shared; this.user_id = userId; this.media_id = mediaId; } @Override public int describeContents() { return 0; } // Marshalling @Override public void writeToParcel(Parcel dest, int flags) { try { dest.writeLong(id); if (remote_id != null) { dest.writeLong(remote_id); } dest.writeString(title); dest.writeString(text); if (tag != null) { dest.writeString(tag); } dest.writeByte((byte) (shared ? 1: 0)); //if shared == true, byte = 1 dest.writeLong(remote_media_id); dest.writeString(author); dest.writeLong(user_id); dest.writeLong(media_id); } catch (NullPointerException e) { e.printStackTrace(); } } public static final Parcelable.Creator<GuerrillaProse> CREATOR = new Parcelable.Creator<GuerrillaProse>() { public GuerrillaProse createFromParcel(Parcel in) { return new GuerrillaProse(in); } public GuerrillaProse[] newArray(int size) { return new GuerrillaProse[size]; } }; // KEEP METHODS END }