|
|
@@ -0,0 +1,253 @@
|
|
|
+package com.sheep.gamegroup.greendao.download;
|
|
|
+
|
|
|
+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;
|
|
|
+
|
|
|
+// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
|
|
|
+/**
|
|
|
+ * DAO for table "SHEEP_AD".
|
|
|
+*/
|
|
|
+public class SheepAdDao extends AbstractDao<SheepAd, Long> {
|
|
|
+
|
|
|
+ public static final String TABLENAME = "SHEEP_AD";
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Properties of entity SheepAd.<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 Ad_id = new Property(1, long.class, "ad_id", false, "ad_id");
|
|
|
+ public final static Property Name = new Property(2, String.class, "name", false, "name");
|
|
|
+ public final static Property Ad_img = new Property(3, String.class, "ad_img", false, "ad_img");
|
|
|
+ public final static Property Form = new Property(4, int.class, "form", false, "form");
|
|
|
+ public final static Property Jump_form = new Property(5, int.class, "jump_form", false, "jump_form");
|
|
|
+ public final static Property Jump_type = new Property(6, int.class, "jump_type", false, "jump_type");
|
|
|
+ public final static Property Jump_url = new Property(7, String.class, "jump_url", false, "jump_url");
|
|
|
+ public final static Property Link_id = new Property(8, long.class, "link_id", false, "link_id");
|
|
|
+ public final static Property Link_type = new Property(9, int.class, "link_type", false, "link_type");
|
|
|
+ public final static Property Start_time = new Property(10, long.class, "start_time", false, "start_time");
|
|
|
+ public final static Property End_time = new Property(11, long.class, "end_time", false, "end_time");
|
|
|
+ public final static Property Platform = new Property(12, int.class, "platform", false, "platform");
|
|
|
+ public final static Property Status = new Property(13, int.class, "status", false, "status");
|
|
|
+ public final static Property User_id = new Property(14, long.class, "user_id", false, "user_id");
|
|
|
+ public final static Property User_name = new Property(15, String.class, "user_name", false, "user_name");
|
|
|
+ public final static Property User_type = new Property(16, int.class, "user_type", false, "user_type");
|
|
|
+ public final static Property Create_time = new Property(17, long.class, "create_time", false, "create_time");
|
|
|
+ public final static Property Update_time = new Property(18, long.class, "update_time", false, "update_time");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public SheepAdDao(DaoConfig config) {
|
|
|
+ super(config);
|
|
|
+ }
|
|
|
+
|
|
|
+ public SheepAdDao(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 + "\"SHEEP_AD\" (" + //
|
|
|
+ "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
|
|
|
+ "\"ad_id\" INTEGER NOT NULL ," + // 1: ad_id
|
|
|
+ "\"name\" TEXT," + // 2: name
|
|
|
+ "\"ad_img\" TEXT," + // 3: ad_img
|
|
|
+ "\"form\" INTEGER NOT NULL ," + // 4: form
|
|
|
+ "\"jump_form\" INTEGER NOT NULL ," + // 5: jump_form
|
|
|
+ "\"jump_type\" INTEGER NOT NULL ," + // 6: jump_type
|
|
|
+ "\"jump_url\" TEXT," + // 7: jump_url
|
|
|
+ "\"link_id\" INTEGER NOT NULL ," + // 8: link_id
|
|
|
+ "\"link_type\" INTEGER NOT NULL ," + // 9: link_type
|
|
|
+ "\"start_time\" INTEGER NOT NULL ," + // 10: start_time
|
|
|
+ "\"end_time\" INTEGER NOT NULL ," + // 11: end_time
|
|
|
+ "\"platform\" INTEGER NOT NULL ," + // 12: platform
|
|
|
+ "\"status\" INTEGER NOT NULL ," + // 13: status
|
|
|
+ "\"user_id\" INTEGER NOT NULL ," + // 14: user_id
|
|
|
+ "\"user_name\" TEXT," + // 15: user_name
|
|
|
+ "\"user_type\" INTEGER NOT NULL ," + // 16: user_type
|
|
|
+ "\"create_time\" INTEGER NOT NULL ," + // 17: create_time
|
|
|
+ "\"update_time\" INTEGER NOT NULL );"); // 18: update_time
|
|
|
+ }
|
|
|
+
|
|
|
+ /** Drops the underlying database table. */
|
|
|
+ public static void dropTable(Database db, boolean ifExists) {
|
|
|
+ String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"SHEEP_AD\"";
|
|
|
+ db.execSQL(sql);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected final void bindValues(DatabaseStatement stmt, SheepAd entity) {
|
|
|
+ stmt.clearBindings();
|
|
|
+
|
|
|
+ Long id = entity.getId();
|
|
|
+ if (id != null) {
|
|
|
+ stmt.bindLong(1, id);
|
|
|
+ }
|
|
|
+ stmt.bindLong(2, entity.getAd_id());
|
|
|
+
|
|
|
+ String name = entity.getName();
|
|
|
+ if (name != null) {
|
|
|
+ stmt.bindString(3, name);
|
|
|
+ }
|
|
|
+
|
|
|
+ String ad_img = entity.getAd_img();
|
|
|
+ if (ad_img != null) {
|
|
|
+ stmt.bindString(4, ad_img);
|
|
|
+ }
|
|
|
+ stmt.bindLong(5, entity.getForm());
|
|
|
+ stmt.bindLong(6, entity.getJump_form());
|
|
|
+ stmt.bindLong(7, entity.getJump_type());
|
|
|
+
|
|
|
+ String jump_url = entity.getJump_url();
|
|
|
+ if (jump_url != null) {
|
|
|
+ stmt.bindString(8, jump_url);
|
|
|
+ }
|
|
|
+ stmt.bindLong(9, entity.getLink_id());
|
|
|
+ stmt.bindLong(10, entity.getLink_type());
|
|
|
+ stmt.bindLong(11, entity.getStart_time());
|
|
|
+ stmt.bindLong(12, entity.getEnd_time());
|
|
|
+ stmt.bindLong(13, entity.getPlatform());
|
|
|
+ stmt.bindLong(14, entity.getStatus());
|
|
|
+ stmt.bindLong(15, entity.getUser_id());
|
|
|
+
|
|
|
+ String user_name = entity.getUser_name();
|
|
|
+ if (user_name != null) {
|
|
|
+ stmt.bindString(16, user_name);
|
|
|
+ }
|
|
|
+ stmt.bindLong(17, entity.getUser_type());
|
|
|
+ stmt.bindLong(18, entity.getCreate_time());
|
|
|
+ stmt.bindLong(19, entity.getUpdate_time());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected final void bindValues(SQLiteStatement stmt, SheepAd entity) {
|
|
|
+ stmt.clearBindings();
|
|
|
+
|
|
|
+ Long id = entity.getId();
|
|
|
+ if (id != null) {
|
|
|
+ stmt.bindLong(1, id);
|
|
|
+ }
|
|
|
+ stmt.bindLong(2, entity.getAd_id());
|
|
|
+
|
|
|
+ String name = entity.getName();
|
|
|
+ if (name != null) {
|
|
|
+ stmt.bindString(3, name);
|
|
|
+ }
|
|
|
+
|
|
|
+ String ad_img = entity.getAd_img();
|
|
|
+ if (ad_img != null) {
|
|
|
+ stmt.bindString(4, ad_img);
|
|
|
+ }
|
|
|
+ stmt.bindLong(5, entity.getForm());
|
|
|
+ stmt.bindLong(6, entity.getJump_form());
|
|
|
+ stmt.bindLong(7, entity.getJump_type());
|
|
|
+
|
|
|
+ String jump_url = entity.getJump_url();
|
|
|
+ if (jump_url != null) {
|
|
|
+ stmt.bindString(8, jump_url);
|
|
|
+ }
|
|
|
+ stmt.bindLong(9, entity.getLink_id());
|
|
|
+ stmt.bindLong(10, entity.getLink_type());
|
|
|
+ stmt.bindLong(11, entity.getStart_time());
|
|
|
+ stmt.bindLong(12, entity.getEnd_time());
|
|
|
+ stmt.bindLong(13, entity.getPlatform());
|
|
|
+ stmt.bindLong(14, entity.getStatus());
|
|
|
+ stmt.bindLong(15, entity.getUser_id());
|
|
|
+
|
|
|
+ String user_name = entity.getUser_name();
|
|
|
+ if (user_name != null) {
|
|
|
+ stmt.bindString(16, user_name);
|
|
|
+ }
|
|
|
+ stmt.bindLong(17, entity.getUser_type());
|
|
|
+ stmt.bindLong(18, entity.getCreate_time());
|
|
|
+ stmt.bindLong(19, entity.getUpdate_time());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Long readKey(Cursor cursor, int offset) {
|
|
|
+ return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public SheepAd readEntity(Cursor cursor, int offset) {
|
|
|
+ SheepAd entity = new SheepAd( //
|
|
|
+ cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
|
|
|
+ cursor.getLong(offset + 1), // ad_id
|
|
|
+ cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name
|
|
|
+ cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // ad_img
|
|
|
+ cursor.getInt(offset + 4), // form
|
|
|
+ cursor.getInt(offset + 5), // jump_form
|
|
|
+ cursor.getInt(offset + 6), // jump_type
|
|
|
+ cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // jump_url
|
|
|
+ cursor.getLong(offset + 8), // link_id
|
|
|
+ cursor.getInt(offset + 9), // link_type
|
|
|
+ cursor.getLong(offset + 10), // start_time
|
|
|
+ cursor.getLong(offset + 11), // end_time
|
|
|
+ cursor.getInt(offset + 12), // platform
|
|
|
+ cursor.getInt(offset + 13), // status
|
|
|
+ cursor.getLong(offset + 14), // user_id
|
|
|
+ cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // user_name
|
|
|
+ cursor.getInt(offset + 16), // user_type
|
|
|
+ cursor.getLong(offset + 17), // create_time
|
|
|
+ cursor.getLong(offset + 18) // update_time
|
|
|
+ );
|
|
|
+ return entity;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void readEntity(Cursor cursor, SheepAd entity, int offset) {
|
|
|
+ entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
|
|
|
+ entity.setAd_id(cursor.getLong(offset + 1));
|
|
|
+ entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
|
|
|
+ entity.setAd_img(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
|
|
|
+ entity.setForm(cursor.getInt(offset + 4));
|
|
|
+ entity.setJump_form(cursor.getInt(offset + 5));
|
|
|
+ entity.setJump_type(cursor.getInt(offset + 6));
|
|
|
+ entity.setJump_url(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
|
|
|
+ entity.setLink_id(cursor.getLong(offset + 8));
|
|
|
+ entity.setLink_type(cursor.getInt(offset + 9));
|
|
|
+ entity.setStart_time(cursor.getLong(offset + 10));
|
|
|
+ entity.setEnd_time(cursor.getLong(offset + 11));
|
|
|
+ entity.setPlatform(cursor.getInt(offset + 12));
|
|
|
+ entity.setStatus(cursor.getInt(offset + 13));
|
|
|
+ entity.setUser_id(cursor.getLong(offset + 14));
|
|
|
+ entity.setUser_name(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
|
|
|
+ entity.setUser_type(cursor.getInt(offset + 16));
|
|
|
+ entity.setCreate_time(cursor.getLong(offset + 17));
|
|
|
+ entity.setUpdate_time(cursor.getLong(offset + 18));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected final Long updateKeyAfterInsert(SheepAd entity, long rowId) {
|
|
|
+ entity.setId(rowId);
|
|
|
+ return rowId;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Long getKey(SheepAd entity) {
|
|
|
+ if(entity != null) {
|
|
|
+ return entity.getId();
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean hasKey(SheepAd entity) {
|
|
|
+ return entity.getId() != null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected final boolean isEntityUpdateable() {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|