3a460677f0bbfcd929f6d82742f98867f276ec16.svn-base 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 Type = new Property(2, int.class, "type", false, "TYPE");
  24. public final static Property IsWarning = new Property(3, boolean.class, "isWarning", false, "IS_WARNING");
  25. }
  26. public NRCReportEntityDao(DaoConfig config) {
  27. super(config);
  28. }
  29. public NRCReportEntityDao(DaoConfig config, DaoSession daoSession) {
  30. super(config, daoSession);
  31. }
  32. /** Creates the underlying database table. */
  33. public static void createTable(Database db, boolean ifNotExists) {
  34. String constraint = ifNotExists? "IF NOT EXISTS ": "";
  35. db.execSQL("CREATE TABLE " + constraint + "\"NRCREPORT_ENTITY\" (" + //
  36. "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
  37. "\"VN_DETAIL_BEAN\" TEXT," + // 1: vnDetailBean
  38. "\"TYPE\" INTEGER NOT NULL ," + // 2: type
  39. "\"IS_WARNING\" INTEGER NOT NULL );"); // 3: isWarning
  40. }
  41. /** Drops the underlying database table. */
  42. public static void dropTable(Database db, boolean ifExists) {
  43. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NRCREPORT_ENTITY\"";
  44. db.execSQL(sql);
  45. }
  46. @Override
  47. protected final void bindValues(DatabaseStatement stmt, NRCReportEntity entity) {
  48. stmt.clearBindings();
  49. Long id = entity.getId();
  50. if (id != null) {
  51. stmt.bindLong(1, id);
  52. }
  53. String vnDetailBean = entity.getVnDetailBean();
  54. if (vnDetailBean != null) {
  55. stmt.bindString(2, vnDetailBean);
  56. }
  57. stmt.bindLong(3, entity.getType());
  58. stmt.bindLong(4, entity.getIsWarning() ? 1L: 0L);
  59. }
  60. @Override
  61. protected final void bindValues(SQLiteStatement stmt, NRCReportEntity entity) {
  62. stmt.clearBindings();
  63. Long id = entity.getId();
  64. if (id != null) {
  65. stmt.bindLong(1, id);
  66. }
  67. String vnDetailBean = entity.getVnDetailBean();
  68. if (vnDetailBean != null) {
  69. stmt.bindString(2, vnDetailBean);
  70. }
  71. stmt.bindLong(3, entity.getType());
  72. stmt.bindLong(4, entity.getIsWarning() ? 1L: 0L);
  73. }
  74. @Override
  75. public Long readKey(Cursor cursor, int offset) {
  76. return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
  77. }
  78. @Override
  79. public NRCReportEntity readEntity(Cursor cursor, int offset) {
  80. NRCReportEntity entity = new NRCReportEntity( //
  81. cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
  82. cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // vnDetailBean
  83. cursor.getInt(offset + 2), // type
  84. cursor.getShort(offset + 3) != 0 // isWarning
  85. );
  86. return entity;
  87. }
  88. @Override
  89. public void readEntity(Cursor cursor, NRCReportEntity entity, int offset) {
  90. entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
  91. entity.setVnDetailBean(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  92. entity.setType(cursor.getInt(offset + 2));
  93. entity.setIsWarning(cursor.getShort(offset + 3) != 0);
  94. }
  95. @Override
  96. protected final Long updateKeyAfterInsert(NRCReportEntity entity, long rowId) {
  97. entity.setId(rowId);
  98. return rowId;
  99. }
  100. @Override
  101. public Long getKey(NRCReportEntity entity) {
  102. if(entity != null) {
  103. return entity.getId();
  104. } else {
  105. return null;
  106. }
  107. }
  108. @Override
  109. public boolean hasKey(NRCReportEntity entity) {
  110. return entity.getId() != null;
  111. }
  112. @Override
  113. protected final boolean isEntityUpdateable() {
  114. return true;
  115. }
  116. }