ReceiptInfoDao.java
7.84 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
package com.huaheng.wms.wmsgreendao;
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;
import com.huaheng.wms.work.collectgoods.ReceiptInfo;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "RECEIPT_INFO".
*/
public class ReceiptInfoDao extends AbstractDao<ReceiptInfo, Long> {
public static final String TABLENAME = "RECEIPT_INFO";
/**
* Properties of entity ReceiptInfo.<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 SysQty = new Property(1, float.class, "sysQty", false, "SYS_QTY");
public final static Property Unit = new Property(2, String.class, "unit", false, "UNIT");
public final static Property Qty = new Property(3, float.class, "qty", false, "QTY");
public final static Property Name = new Property(4, String.class, "name", false, "NAME");
public final static Property MaterialCode = new Property(5, String.class, "materialCode", false, "MATERIAL_CODE");
public final static Property Id = new Property(6, String.class, "id", false, "ID");
public final static Property ReceiptCode = new Property(7, String.class, "receiptCode", false, "RECEIPT_CODE");
public final static Property ReceiptId = new Property(8, String.class, "receiptId", false, "RECEIPT_ID");
public final static Property Quality = new Property(9, String.class, "quality", false, "QUALITY");
}
public ReceiptInfoDao(DaoConfig config) {
super(config);
}
public ReceiptInfoDao(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 + "\"RECEIPT_INFO\" (" + //
"\"_id\" INTEGER PRIMARY KEY NOT NULL ," + // 0: _id
"\"SYS_QTY\" REAL NOT NULL ," + // 1: sysQty
"\"UNIT\" TEXT," + // 2: unit
"\"QTY\" REAL NOT NULL ," + // 3: qty
"\"NAME\" TEXT," + // 4: name
"\"MATERIAL_CODE\" TEXT," + // 5: materialCode
"\"ID\" TEXT," + // 6: id
"\"RECEIPT_CODE\" TEXT," + // 7: receiptCode
"\"RECEIPT_ID\" TEXT," + // 8: receiptId
"\"QUALITY\" TEXT);"); // 9: quality
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"RECEIPT_INFO\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, ReceiptInfo entity) {
stmt.clearBindings();
stmt.bindLong(1, entity.get_id());
stmt.bindDouble(2, entity.getSysQty());
String unit = entity.getUnit();
if (unit != null) {
stmt.bindString(3, unit);
}
stmt.bindDouble(4, entity.getQty());
String name = entity.getName();
if (name != null) {
stmt.bindString(5, name);
}
String materialCode = entity.getMaterialCode();
if (materialCode != null) {
stmt.bindString(6, materialCode);
}
String id = entity.getId();
if (id != null) {
stmt.bindString(7, id);
}
String receiptCode = entity.getReceiptCode();
if (receiptCode != null) {
stmt.bindString(8, receiptCode);
}
String receiptId = entity.getReceiptId();
if (receiptId != null) {
stmt.bindString(9, receiptId);
}
String quality = entity.getQuality();
if (quality != null) {
stmt.bindString(10, quality);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, ReceiptInfo entity) {
stmt.clearBindings();
stmt.bindLong(1, entity.get_id());
stmt.bindDouble(2, entity.getSysQty());
String unit = entity.getUnit();
if (unit != null) {
stmt.bindString(3, unit);
}
stmt.bindDouble(4, entity.getQty());
String name = entity.getName();
if (name != null) {
stmt.bindString(5, name);
}
String materialCode = entity.getMaterialCode();
if (materialCode != null) {
stmt.bindString(6, materialCode);
}
String id = entity.getId();
if (id != null) {
stmt.bindString(7, id);
}
String receiptCode = entity.getReceiptCode();
if (receiptCode != null) {
stmt.bindString(8, receiptCode);
}
String receiptId = entity.getReceiptId();
if (receiptId != null) {
stmt.bindString(9, receiptId);
}
String quality = entity.getQuality();
if (quality != null) {
stmt.bindString(10, quality);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.getLong(offset + 0);
}
@Override
public ReceiptInfo readEntity(Cursor cursor, int offset) {
ReceiptInfo entity = new ReceiptInfo( //
cursor.getLong(offset + 0), // _id
cursor.getFloat(offset + 1), // sysQty
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // unit
cursor.getFloat(offset + 3), // qty
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // name
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // materialCode
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // id
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // receiptCode
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // receiptId
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // quality
);
return entity;
}
@Override
public void readEntity(Cursor cursor, ReceiptInfo entity, int offset) {
entity.set_id(cursor.getLong(offset + 0));
entity.setSysQty(cursor.getFloat(offset + 1));
entity.setUnit(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setQty(cursor.getFloat(offset + 3));
entity.setName(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setMaterialCode(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setReceiptCode(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setReceiptId(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setQuality(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
}
@Override
protected final Long updateKeyAfterInsert(ReceiptInfo entity, long rowId) {
entity.set_id(rowId);
return rowId;
}
@Override
public Long getKey(ReceiptInfo entity) {
if(entity != null) {
return entity.get_id();
} else {
return null;
}
}
@Override
public boolean hasKey(ReceiptInfo entity) {
throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}