| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- package greendao;
- import android.database.Cursor;
- import android.database.sqlite.SQLiteStatement;
- import org.greenrobot.greendao.AbstractDao;
- import org.greenrobot.greendao.Property;
- import org.greenrobot.greendao.internal.DaoConfig;
- import org.greenrobot.greendao.database.Database;
- import org.greenrobot.greendao.database.DatabaseStatement;
- import eVVM.apk.entity.NRCReportEntity;
- // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
- /**
- * DAO for table "NRCREPORT_ENTITY".
- */
- public class NRCReportEntityDao extends AbstractDao<NRCReportEntity, Long> {
- public static final String TABLENAME = "NRCREPORT_ENTITY";
- /**
- * Properties of entity NRCReportEntity.<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 VnDetailBean = new Property(1, String.class, "vnDetailBean", false, "VN_DETAIL_BEAN");
- public final static Property Inoculator = new Property(2, String.class, "inoculator", false, "INOCULATOR");
- public final static Property Type = new Property(3, int.class, "type", false, "TYPE");
- public final static Property IsWarning = new Property(4, boolean.class, "isWarning", false, "IS_WARNING");
- }
- public NRCReportEntityDao(DaoConfig config) {
- super(config);
- }
-
- public NRCReportEntityDao(DaoConfig config, DaoSession daoSession) {
- super(config, daoSession);
- }
- /** Creates the underlying database table. */
- public static void createTable(Database db, boolean ifNotExists) {
- String constraint = ifNotExists? "IF NOT EXISTS ": "";
- db.execSQL("CREATE TABLE " + constraint + "\"NRCREPORT_ENTITY\" (" + //
- "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
- "\"VN_DETAIL_BEAN\" TEXT," + // 1: vnDetailBean
- "\"INOCULATOR\" TEXT," + // 2: inoculator
- "\"TYPE\" INTEGER NOT NULL ," + // 3: type
- "\"IS_WARNING\" INTEGER NOT NULL );"); // 4: isWarning
- }
- /** Drops the underlying database table. */
- public static void dropTable(Database db, boolean ifExists) {
- String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NRCREPORT_ENTITY\"";
- db.execSQL(sql);
- }
- @Override
- protected final void bindValues(DatabaseStatement stmt, NRCReportEntity entity) {
- stmt.clearBindings();
-
- Long id = entity.getId();
- if (id != null) {
- stmt.bindLong(1, id);
- }
-
- String vnDetailBean = entity.getVnDetailBean();
- if (vnDetailBean != null) {
- stmt.bindString(2, vnDetailBean);
- }
-
- String inoculator = entity.getInoculator();
- if (inoculator != null) {
- stmt.bindString(3, inoculator);
- }
- stmt.bindLong(4, entity.getType());
- stmt.bindLong(5, entity.getIsWarning() ? 1L: 0L);
- }
- @Override
- protected final void bindValues(SQLiteStatement stmt, NRCReportEntity entity) {
- stmt.clearBindings();
-
- Long id = entity.getId();
- if (id != null) {
- stmt.bindLong(1, id);
- }
-
- String vnDetailBean = entity.getVnDetailBean();
- if (vnDetailBean != null) {
- stmt.bindString(2, vnDetailBean);
- }
-
- String inoculator = entity.getInoculator();
- if (inoculator != null) {
- stmt.bindString(3, inoculator);
- }
- stmt.bindLong(4, entity.getType());
- stmt.bindLong(5, entity.getIsWarning() ? 1L: 0L);
- }
- @Override
- public Long readKey(Cursor cursor, int offset) {
- return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
- }
- @Override
- public NRCReportEntity readEntity(Cursor cursor, int offset) {
- NRCReportEntity entity = new NRCReportEntity( //
- cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
- cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // vnDetailBean
- cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // inoculator
- cursor.getInt(offset + 3), // type
- cursor.getShort(offset + 4) != 0 // isWarning
- );
- return entity;
- }
-
- @Override
- public void readEntity(Cursor cursor, NRCReportEntity entity, int offset) {
- entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
- entity.setVnDetailBean(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
- entity.setInoculator(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
- entity.setType(cursor.getInt(offset + 3));
- entity.setIsWarning(cursor.getShort(offset + 4) != 0);
- }
-
- @Override
- protected final Long updateKeyAfterInsert(NRCReportEntity entity, long rowId) {
- entity.setId(rowId);
- return rowId;
- }
-
- @Override
- public Long getKey(NRCReportEntity entity) {
- if(entity != null) {
- return entity.getId();
- } else {
- return null;
- }
- }
- @Override
- public boolean hasKey(NRCReportEntity entity) {
- return entity.getId() != null;
- }
- @Override
- protected final boolean isEntityUpdateable() {
- return true;
- }
-
- }
|