b2c7d68bc00ab55780adae12a905878b754069cc.svn-base 6.0 KB

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