LiveAlertDao.java
6.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
package com.cmcc.migutvtwo.dao;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.Property;
import de.greenrobot.dao.internal.DaoConfig;
import com.cmcc.migutvtwo.dao.LiveAlert;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table LIVE_ALERT.
*/
public class LiveAlertDao extends AbstractDao<LiveAlert, String> {
public static final String TABLENAME = "LIVE_ALERT";
/**
* Properties of entity LiveAlert.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Id = new Property(0, String.class, "id", true, "ID");
public final static Property Num = new Property(1, String.class, "num", false, "NUM");
public final static Property Date = new Property(2, String.class, "date", false, "DATE");
public final static Property Time = new Property(3, String.class, "time", false, "TIME");
public final static Property Title = new Property(4, String.class, "title", false, "TITLE");
public final static Property Contid = new Property(5, String.class, "contid", false, "CONTID");
public final static Property LiveName = new Property(6, String.class, "liveName", false, "LIVE_NAME");
public final static Property Extend1 = new Property(7, String.class, "extend1", false, "EXTEND1");
public final static Property Alert_time = new Property(8, java.util.Date.class, "alert_time", false, "ALERT_TIME");
};
public LiveAlertDao(DaoConfig config) {
super(config);
}
public LiveAlertDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "'LIVE_ALERT' (" + //
"'ID' TEXT PRIMARY KEY NOT NULL ," + // 0: id
"'NUM' TEXT," + // 1: num
"'DATE' TEXT," + // 2: date
"'TIME' TEXT," + // 3: time
"'TITLE' TEXT," + // 4: title
"'CONTID' TEXT," + // 5: contid
"'LIVE_NAME' TEXT," + // 6: liveName
"'EXTEND1' TEXT," + // 7: extend1
"'ALERT_TIME' INTEGER);"); // 8: alert_time
}
/** Drops the underlying database table. */
public static void dropTable(SQLiteDatabase db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "'LIVE_ALERT'";
db.execSQL(sql);
}
/** @inheritdoc */
@Override
protected void bindValues(SQLiteStatement stmt, LiveAlert entity) {
stmt.clearBindings();
String id = entity.getId();
if (id != null) {
stmt.bindString(1, id);
}
String num = entity.getNum();
if (num != null) {
stmt.bindString(2, num);
}
String date = entity.getDate();
if (date != null) {
stmt.bindString(3, date);
}
String time = entity.getTime();
if (time != null) {
stmt.bindString(4, time);
}
String title = entity.getTitle();
if (title != null) {
stmt.bindString(5, title);
}
String contid = entity.getContid();
if (contid != null) {
stmt.bindString(6, contid);
}
String liveName = entity.getLiveName();
if (liveName != null) {
stmt.bindString(7, liveName);
}
String extend1 = entity.getExtend1();
if (extend1 != null) {
stmt.bindString(8, extend1);
}
java.util.Date alert_time = entity.getAlert_time();
if (alert_time != null) {
stmt.bindLong(9, alert_time.getTime());
}
}
/** @inheritdoc */
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
}
/** @inheritdoc */
@Override
public LiveAlert readEntity(Cursor cursor, int offset) {
LiveAlert entity = new LiveAlert( //
cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // id
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // num
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // date
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // time
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // title
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // contid
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // liveName
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // extend1
cursor.isNull(offset + 8) ? null : new java.util.Date(cursor.getLong(offset + 8)) // alert_time
);
return entity;
}
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, LiveAlert entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
entity.setNum(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setDate(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setTitle(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setContid(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setLiveName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setExtend1(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setAlert_time(cursor.isNull(offset + 8) ? null : new java.util.Date(cursor.getLong(offset + 8)));
}
/** @inheritdoc */
@Override
protected String updateKeyAfterInsert(LiveAlert entity, long rowId) {
return entity.getId();
}
/** @inheritdoc */
@Override
public String getKey(LiveAlert entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
/** @inheritdoc */
@Override
protected boolean isEntityUpdateable() {
return true;
}
}