0d7a50b3cb5d4b9adee61fc572a000198feb1e85.svn-base 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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.NetReConnectEntity;
  10. // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  11. /**
  12. * DAO for table "NET_RE_CONNECT_ENTITY".
  13. */
  14. public class NetReConnectEntityDao extends AbstractDao<NetReConnectEntity, Long> {
  15. public static final String TABLENAME = "NET_RE_CONNECT_ENTITY";
  16. /**
  17. * Properties of entity NetReConnectEntity.<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 InterfaceName = new Property(1, String.class, "interfaceName", false, "INTERFACE_NAME");
  23. public final static Property InterfaceUrl = new Property(2, String.class, "interfaceUrl", false, "INTERFACE_URL");
  24. public final static Property Jsonmap = new Property(3, String.class, "jsonmap", false, "JSONMAP");
  25. public final static Property Inoculator = new Property(4, String.class, "inoculator", false, "INOCULATOR");
  26. public final static Property Type = new Property(5, int.class, "type", false, "TYPE");
  27. public final static Property IsWarning = new Property(6, boolean.class, "isWarning", false, "IS_WARNING");
  28. }
  29. public NetReConnectEntityDao(DaoConfig config) {
  30. super(config);
  31. }
  32. public NetReConnectEntityDao(DaoConfig config, DaoSession daoSession) {
  33. super(config, daoSession);
  34. }
  35. /** Creates the underlying database table. */
  36. public static void createTable(Database db, boolean ifNotExists) {
  37. String constraint = ifNotExists? "IF NOT EXISTS ": "";
  38. db.execSQL("CREATE TABLE " + constraint + "\"NET_RE_CONNECT_ENTITY\" (" + //
  39. "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
  40. "\"INTERFACE_NAME\" TEXT," + // 1: interfaceName
  41. "\"INTERFACE_URL\" TEXT," + // 2: interfaceUrl
  42. "\"JSONMAP\" TEXT," + // 3: jsonmap
  43. "\"INOCULATOR\" TEXT," + // 4: inoculator
  44. "\"TYPE\" INTEGER NOT NULL ," + // 5: type
  45. "\"IS_WARNING\" INTEGER NOT NULL );"); // 6: isWarning
  46. }
  47. /** Drops the underlying database table. */
  48. public static void dropTable(Database db, boolean ifExists) {
  49. String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NET_RE_CONNECT_ENTITY\"";
  50. db.execSQL(sql);
  51. }
  52. @Override
  53. protected final void bindValues(DatabaseStatement stmt, NetReConnectEntity entity) {
  54. stmt.clearBindings();
  55. Long id = entity.getId();
  56. if (id != null) {
  57. stmt.bindLong(1, id);
  58. }
  59. String interfaceName = entity.getInterfaceName();
  60. if (interfaceName != null) {
  61. stmt.bindString(2, interfaceName);
  62. }
  63. String interfaceUrl = entity.getInterfaceUrl();
  64. if (interfaceUrl != null) {
  65. stmt.bindString(3, interfaceUrl);
  66. }
  67. String jsonmap = entity.getJsonmap();
  68. if (jsonmap != null) {
  69. stmt.bindString(4, jsonmap);
  70. }
  71. String inoculator = entity.getInoculator();
  72. if (inoculator != null) {
  73. stmt.bindString(5, inoculator);
  74. }
  75. stmt.bindLong(6, entity.getType());
  76. stmt.bindLong(7, entity.getIsWarning() ? 1L: 0L);
  77. }
  78. @Override
  79. protected final void bindValues(SQLiteStatement stmt, NetReConnectEntity entity) {
  80. stmt.clearBindings();
  81. Long id = entity.getId();
  82. if (id != null) {
  83. stmt.bindLong(1, id);
  84. }
  85. String interfaceName = entity.getInterfaceName();
  86. if (interfaceName != null) {
  87. stmt.bindString(2, interfaceName);
  88. }
  89. String interfaceUrl = entity.getInterfaceUrl();
  90. if (interfaceUrl != null) {
  91. stmt.bindString(3, interfaceUrl);
  92. }
  93. String jsonmap = entity.getJsonmap();
  94. if (jsonmap != null) {
  95. stmt.bindString(4, jsonmap);
  96. }
  97. String inoculator = entity.getInoculator();
  98. if (inoculator != null) {
  99. stmt.bindString(5, inoculator);
  100. }
  101. stmt.bindLong(6, entity.getType());
  102. stmt.bindLong(7, entity.getIsWarning() ? 1L: 0L);
  103. }
  104. @Override
  105. public Long readKey(Cursor cursor, int offset) {
  106. return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
  107. }
  108. @Override
  109. public NetReConnectEntity readEntity(Cursor cursor, int offset) {
  110. NetReConnectEntity entity = new NetReConnectEntity( //
  111. cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
  112. cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // interfaceName
  113. cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // interfaceUrl
  114. cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // jsonmap
  115. cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // inoculator
  116. cursor.getInt(offset + 5), // type
  117. cursor.getShort(offset + 6) != 0 // isWarning
  118. );
  119. return entity;
  120. }
  121. @Override
  122. public void readEntity(Cursor cursor, NetReConnectEntity entity, int offset) {
  123. entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
  124. entity.setInterfaceName(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  125. entity.setInterfaceUrl(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  126. entity.setJsonmap(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  127. entity.setInoculator(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
  128. entity.setType(cursor.getInt(offset + 5));
  129. entity.setIsWarning(cursor.getShort(offset + 6) != 0);
  130. }
  131. @Override
  132. protected final Long updateKeyAfterInsert(NetReConnectEntity entity, long rowId) {
  133. entity.setId(rowId);
  134. return rowId;
  135. }
  136. @Override
  137. public Long getKey(NetReConnectEntity entity) {
  138. if(entity != null) {
  139. return entity.getId();
  140. } else {
  141. return null;
  142. }
  143. }
  144. @Override
  145. public boolean hasKey(NetReConnectEntity entity) {
  146. return entity.getId() != null;
  147. }
  148. @Override
  149. protected final boolean isEntityUpdateable() {
  150. return true;
  151. }
  152. }