package model.daoModels; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteStatement; import de.greenrobot.dao.AbstractDao; import de.greenrobot.dao.Property; import de.greenrobot.dao.internal.DaoConfig; import model.daoModels.SigningOrganization; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * DAO for table "SIGNING_ORGANIZATION". */ public class SigningOrganizationDao extends AbstractDao<SigningOrganization, Long> { public static final String TABLENAME = "SIGNING_ORGANIZATION"; /** * Properties of entity SigningOrganization.<br/> * Can be used for QueryBuilder and for referencing column names. */ public static class Properties { public final static Property Id = new Property(0, Long.class, "id", true, "_id"); public final static Property Email = new Property(1, String.class, "email", false, "EMAIL"); public final static Property Name = new Property(2, String.class, "name", false, "NAME"); public final static Property Url = new Property(3, String.class, "url", false, "URL"); public final static Property UniqueSlug = new Property(4, String.class, "uniqueSlug", false, "UNIQUE_SLUG"); public final static Property Slug = new Property(5, String.class, "slug", false, "SLUG"); public final static Property CreatedAt = new Property(6, java.util.Date.class, "createdAt", false, "CREATED_AT"); public final static Property ExpiresAt = new Property(7, java.util.Date.class, "expiresAt", false, "EXPIRES_AT"); public final static Property ModifiedAt = new Property(8, java.util.Date.class, "modifiedAt", false, "MODIFIED_AT"); }; public SigningOrganizationDao(DaoConfig config) { super(config); } public SigningOrganizationDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } /** Creates the underlying database table. */ public static void createTable(SQLiteDatabase db, boolean ifNotExists) { String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"SIGNING_ORGANIZATION\" (" + // "\"_id\" INTEGER PRIMARY KEY ," + // 0: id "\"EMAIL\" TEXT," + // 1: email "\"NAME\" TEXT," + // 2: name "\"URL\" TEXT," + // 3: url "\"UNIQUE_SLUG\" TEXT," + // 4: uniqueSlug "\"SLUG\" TEXT," + // 5: slug "\"CREATED_AT\" INTEGER," + // 6: createdAt "\"EXPIRES_AT\" INTEGER," + // 7: expiresAt "\"MODIFIED_AT\" INTEGER);"); // 8: modifiedAt } /** Drops the underlying database table. */ public static void dropTable(SQLiteDatabase db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"SIGNING_ORGANIZATION\""; db.execSQL(sql); } /** @inheritdoc */ @Override protected void bindValues(SQLiteStatement stmt, SigningOrganization entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } String email = entity.getEmail(); if (email != null) { stmt.bindString(2, email); } String name = entity.getName(); if (name != null) { stmt.bindString(3, name); } String url = entity.getUrl(); if (url != null) { stmt.bindString(4, url); } String uniqueSlug = entity.getUniqueSlug(); if (uniqueSlug != null) { stmt.bindString(5, uniqueSlug); } String slug = entity.getSlug(); if (slug != null) { stmt.bindString(6, slug); } java.util.Date createdAt = entity.getCreatedAt(); if (createdAt != null) { stmt.bindLong(7, createdAt.getTime()); } java.util.Date expiresAt = entity.getExpiresAt(); if (expiresAt != null) { stmt.bindLong(8, expiresAt.getTime()); } java.util.Date modifiedAt = entity.getModifiedAt(); if (modifiedAt != null) { stmt.bindLong(9, modifiedAt.getTime()); } } /** @inheritdoc */ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); } /** @inheritdoc */ @Override public SigningOrganization readEntity(Cursor cursor, int offset) { SigningOrganization entity = new SigningOrganization( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // email cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // url cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // uniqueSlug cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // slug cursor.isNull(offset + 6) ? null : new java.util.Date(cursor.getLong(offset + 6)), // createdAt cursor.isNull(offset + 7) ? null : new java.util.Date(cursor.getLong(offset + 7)), // expiresAt cursor.isNull(offset + 8) ? null : new java.util.Date(cursor.getLong(offset + 8)) // modifiedAt ); return entity; } /** @inheritdoc */ @Override public void readEntity(Cursor cursor, SigningOrganization entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setEmail(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setUniqueSlug(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setSlug(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); entity.setCreatedAt(cursor.isNull(offset + 6) ? null : new java.util.Date(cursor.getLong(offset + 6))); entity.setExpiresAt(cursor.isNull(offset + 7) ? null : new java.util.Date(cursor.getLong(offset + 7))); entity.setModifiedAt(cursor.isNull(offset + 8) ? null : new java.util.Date(cursor.getLong(offset + 8))); } /** @inheritdoc */ @Override protected Long updateKeyAfterInsert(SigningOrganization entity, long rowId) { entity.setId(rowId); return rowId; } /** @inheritdoc */ @Override public Long getKey(SigningOrganization entity) { if(entity != null) { return entity.getId(); } else { return null; } } /** @inheritdoc */ @Override protected boolean isEntityUpdateable() { return true; } }