package com.mgw.member; 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 com.mgw.member.Note; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * DAO for table NOTE. */ public class NoteDao extends AbstractDao<Note, Long> { public static final String TABLENAME = "NOTE"; /** * Properties of entity Note.<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 Text = new Property(1, String.class, "text", false, "TEXT"); public final static Property Comment = new Property(2, String.class, "comment", false, "COMMENT"); public final static Property Date = new Property(3, java.util.Date.class, "date", false, "DATE"); public final static Property Nimedd1588 = new Property(4, String.class, "nimedd1588", false, "NIMEDD1588"); }; public NoteDao(DaoConfig config) { super(config); } public NoteDao(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 + "'NOTE' (" + // "'_id' INTEGER PRIMARY KEY ," + // 0: id "'TEXT' TEXT NOT NULL ," + // 1: text "'COMMENT' TEXT," + // 2: comment "'DATE' INTEGER," + // 3: date "'NIMEDD1588' TEXT);"); // 4: nimedd1588 } /** Drops the underlying database table. */ public static void dropTable(SQLiteDatabase db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "'NOTE'"; db.execSQL(sql); } /** @inheritdoc */ @Override protected void bindValues(SQLiteStatement stmt, Note entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } stmt.bindString(2, entity.getText()); String comment = entity.getComment(); if (comment != null) { stmt.bindString(3, comment); } java.util.Date date = entity.getDate(); if (date != null) { stmt.bindLong(4, date.getTime()); } String nimedd1588 = entity.getNimedd1588(); if (nimedd1588 != null) { stmt.bindString(5, nimedd1588); } } /** @inheritdoc */ @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); } /** @inheritdoc */ @Override public Note readEntity(Cursor cursor, int offset) { Note entity = new Note( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.getString(offset + 1), // text cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // comment cursor.isNull(offset + 3) ? null : new java.util.Date(cursor.getLong(offset + 3)), // date cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4) // nimedd1588 ); return entity; } /** @inheritdoc */ @Override public void readEntity(Cursor cursor, Note entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setText(cursor.getString(offset + 1)); entity.setComment(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); entity.setDate(cursor.isNull(offset + 3) ? null : new java.util.Date(cursor.getLong(offset + 3))); entity.setNimedd1588(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); } /** @inheritdoc */ @Override protected Long updateKeyAfterInsert(Note entity, long rowId) { entity.setId(rowId); return rowId; } /** @inheritdoc */ @Override public Long getKey(Note entity) { if(entity != null) { return entity.getId(); } else { return null; } } /** @inheritdoc */ @Override protected boolean isEntityUpdateable() { return true; } }