6fff1ede513bc6ae0772835c9d134553769ace4e.svn-base 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. package greendao;
  2. import android.database.Cursor;
  3. import android.database.sqlite.SQLiteStatement;
  4. import org.greenrobot.greendao.AbstractDao;
  5. import org.greenrobot.greendao.Property;
  6. import org.greenrobot.greendao.internal.DaoConfig;
  7. import org.greenrobot.greendao.database.Database;
  8. import org.greenrobot.greendao.database.DatabaseStatement;
  9. import eVVM.apk.entity.NRCReportEntity;
  10. // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  11. /**
  12. * DAO for table "NRCREPORT_ENTITY".
  13. */
  14. public class NRCReportEntityDao extends AbstractDao<NRCReportEntity, Long> {
  15. public static final String TABLENAME = "NRCREPORT_ENTITY";
  16. /**
  17. * Properties of entity NRCReportEntity.<br/>
  18. * Can be used for QueryBuilder and for referencing column names.
  19. */
  20. public static class Properties {
  21. public final static Property Id = new Property(0, Long.class, "id", true, "_id");
  22. public final static Property VnDetailBean = new Property(1, String.class, "vnDetailBean", false, "VN_DETAIL_BEAN");
  23. public final static Property Inoculator = new Property(2, String.class, "inoculator", false, "INOCULATOR");
  24. public final static Property Type = new Property(3, int.class, "type", false, "TYPE");
  25. public final static Property IsWarning = new Property(4, boolean.class, "isWarning", false, "IS_WARNING");
  26. }
  27. public NRCReportEntityDao(DaoConfig config) {
  28. super(config);
  29. }
  30. public NRCReportEntityDao(DaoConfig config, DaoSession daoSession) {
  31. super(config, daoSession);
  32. }
  33. /** Creates the underlying database table. */
  34. public static void createTable(Database db, boolean ifNotExists) {
  35. String constraint = ifNotExists? "IF NOT EXISTS ": "";
  36. db.execSQL("CREATE TABLE " + constraint + "\"NRCREPORT_ENTITY\" (" + //
  37. "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
  38. "\"VN_DETAIL_BEAN\" TEXT," + // 1: vnDetailBean
  39. "\"INOCULATOR\" TEXT," + // 2: inoculator
  40. "\"TYPE\" INTEGER NOT NULL ," + // 3: type
  41. "\"IS_WARNING\" INTEGER NOT NULL );"); // 4: isWarning
  42. }
  43. /** Drops the underlying database table. */
  44. public static void dropTable(Database db, boolean ifExists) {
  45. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NRCREPORT_ENTITY\"";
  46. db.execSQL(sql);
  47. }
  48. @Override
  49. protected final void bindValues(DatabaseStatement stmt, NRCReportEntity entity) {
  50. stmt.clearBindings();
  51. Long id = entity.getId();
  52. if (id != null) {
  53. stmt.bindLong(1, id);
  54. }
  55. String vnDetailBean = entity.getVnDetailBean();
  56. if (vnDetailBean != null) {
  57. stmt.bindString(2, vnDetailBean);
  58. }
  59. String inoculator = entity.getInoculator();
  60. if (inoculator != null) {
  61. stmt.bindString(3, inoculator);
  62. }
  63. stmt.bindLong(4, entity.getType());
  64. stmt.bindLong(5, entity.getIsWarning() ? 1L: 0L);
  65. }
  66. @Override
  67. protected final void bindValues(SQLiteStatement stmt, NRCReportEntity entity) {
  68. stmt.clearBindings();
  69. Long id = entity.getId();
  70. if (id != null) {
  71. stmt.bindLong(1, id);
  72. }
  73. String vnDetailBean = entity.getVnDetailBean();
  74. if (vnDetailBean != null) {
  75. stmt.bindString(2, vnDetailBean);
  76. }
  77. String inoculator = entity.getInoculator();
  78. if (inoculator != null) {
  79. stmt.bindString(3, inoculator);
  80. }
  81. stmt.bindLong(4, entity.getType());
  82. stmt.bindLong(5, entity.getIsWarning() ? 1L: 0L);
  83. }
  84. @Override
  85. public Long readKey(Cursor cursor, int offset) {
  86. return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
  87. }
  88. @Override
  89. public NRCReportEntity readEntity(Cursor cursor, int offset) {
  90. NRCReportEntity entity = new NRCReportEntity( //
  91. cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
  92. cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // vnDetailBean
  93. cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // inoculator
  94. cursor.getInt(offset + 3), // type
  95. cursor.getShort(offset + 4) != 0 // isWarning
  96. );
  97. return entity;
  98. }
  99. @Override
  100. public void readEntity(Cursor cursor, NRCReportEntity entity, int offset) {
  101. entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
  102. entity.setVnDetailBean(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  103. entity.setInoculator(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  104. entity.setType(cursor.getInt(offset + 3));
  105. entity.setIsWarning(cursor.getShort(offset + 4) != 0);
  106. }
  107. @Override
  108. protected final Long updateKeyAfterInsert(NRCReportEntity entity, long rowId) {
  109. entity.setId(rowId);
  110. return rowId;
  111. }
  112. @Override
  113. public Long getKey(NRCReportEntity entity) {
  114. if(entity != null) {
  115. return entity.getId();
  116. } else {
  117. return null;
  118. }
  119. }
  120. @Override
  121. public boolean hasKey(NRCReportEntity entity) {
  122. return entity.getId() != null;
  123. }
  124. @Override
  125. protected final boolean isEntityUpdateable() {
  126. return true;
  127. }
  128. }