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 . java2s.co m*/ 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 de.handler.mobile.android.bachelorapp.app.database.Guerrilla; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * DAO for table GUERRILLA. */ public class GuerrillaDao extends AbstractDao<Guerrilla, Long> { public static final String TABLENAME = "GUERRILLA"; /** * Properties of entity Guerrilla.<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 Password = new Property(2, String.class, "password", false, "PASSWORD"); public final static Property Surname = new Property(3, String.class, "surname", false, "SURNAME"); public final static Property Name = new Property(4, String.class, "name", false, "NAME"); public final static Property Remember_token = new Property(5, String.class, "remember_token", false, "REMEMBER_TOKEN"); }; private DaoSession daoSession; public GuerrillaDao(DaoConfig config) { super(config); } public GuerrillaDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); this.daoSession = 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 + "'GUERRILLA' (" + // "'_id' INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "'EMAIL' TEXT NOT NULL UNIQUE ," + // 1: email "'PASSWORD' TEXT NOT NULL ," + // 2: password "'SURNAME' TEXT," + // 3: surname "'NAME' TEXT," + // 4: name "'REMEMBER_TOKEN' TEXT);"); // 5: remember_token } /** Drops the underlying database table. */ public static void dropTable(SQLiteDatabase db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "'GUERRILLA'"; db.execSQL(sql); } /** @inheritdoc */ @Override protected void bindValues(SQLiteStatement stmt, Guerrilla entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } stmt.bindString(2, entity.getEmail()); stmt.bindString(3, entity.getPassword()); String surname = entity.getSurname(); if (surname != null) { stmt.bindString(4, surname); } String name = entity.getName(); if (name != null) { stmt.bindString(5, name); } String remember_token = entity.getRemember_token(); if (remember_token != null) { stmt.bindString(6, remember_token); } } @Override protected void attachEntity(Guerrilla entity) { super.attachEntity(entity); entity.__setDaoSession(daoSession); } /** @inheritdoc */ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); } /** @inheritdoc */ @Override public Guerrilla readEntity(Cursor cursor, int offset) { Guerrilla entity = new Guerrilla( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.getString(offset + 1), // email cursor.getString(offset + 2), // password cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // surname cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // name cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // remember_token ); return entity; } /** @inheritdoc */ @Override public void readEntity(Cursor cursor, Guerrilla entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setEmail(cursor.getString(offset + 1)); entity.setPassword(cursor.getString(offset + 2)); entity.setSurname(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setName(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setRemember_token(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); } /** @inheritdoc */ @Override protected Long updateKeyAfterInsert(Guerrilla entity, long rowId) { entity.setId(rowId); return rowId; } /** @inheritdoc */ @Override public Long getKey(Guerrilla entity) { if(entity != null) { return entity.getId(); } else { return null; } } /** @inheritdoc */ @Override protected boolean isEntityUpdateable() { return true; } }