ContainerInfoDao.java
5.89 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
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.onshell.ContainerInfo;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "CONTAINER_INFO".
*/
public class ContainerInfoDao extends AbstractDao<ContainerInfo, Long> {
public static final String TABLENAME = "CONTAINER_INFO";
/**
* Properties of entity ContainerInfo.<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 Qty = new Property(1, float.class, "qty", false, "QTY");
public final static Property Name = new Property(2, String.class, "name", false, "NAME");
public final static Property Id = new Property(3, int.class, "id", false, "ID");
public final static Property LocationCode = new Property(4, String.class, "locationCode", false, "LOCATION_CODE");
public final static Property ReceiptId = new Property(5, int.class, "receiptId", false, "RECEIPT_ID");
public final static Property Barcode = new Property(6, String.class, "barcode", false, "BARCODE");
}
public ContainerInfoDao(DaoConfig config) {
super(config);
}
public ContainerInfoDao(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 + "\"CONTAINER_INFO\" (" + //
"\"_id\" INTEGER PRIMARY KEY NOT NULL ," + // 0: _id
"\"QTY\" REAL NOT NULL ," + // 1: qty
"\"NAME\" TEXT," + // 2: name
"\"ID\" INTEGER NOT NULL ," + // 3: id
"\"LOCATION_CODE\" TEXT," + // 4: locationCode
"\"RECEIPT_ID\" INTEGER NOT NULL ," + // 5: receiptId
"\"BARCODE\" TEXT);"); // 6: barcode
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"CONTAINER_INFO\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, ContainerInfo entity) {
stmt.clearBindings();
stmt.bindLong(1, entity.get_id());
stmt.bindDouble(2, entity.getQty());
String name = entity.getName();
if (name != null) {
stmt.bindString(3, name);
}
stmt.bindLong(4, entity.getId());
String locationCode = entity.getLocationCode();
if (locationCode != null) {
stmt.bindString(5, locationCode);
}
stmt.bindLong(6, entity.getReceiptId());
String barcode = entity.getBarcode();
if (barcode != null) {
stmt.bindString(7, barcode);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, ContainerInfo entity) {
stmt.clearBindings();
stmt.bindLong(1, entity.get_id());
stmt.bindDouble(2, entity.getQty());
String name = entity.getName();
if (name != null) {
stmt.bindString(3, name);
}
stmt.bindLong(4, entity.getId());
String locationCode = entity.getLocationCode();
if (locationCode != null) {
stmt.bindString(5, locationCode);
}
stmt.bindLong(6, entity.getReceiptId());
String barcode = entity.getBarcode();
if (barcode != null) {
stmt.bindString(7, barcode);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.getLong(offset + 0);
}
@Override
public ContainerInfo readEntity(Cursor cursor, int offset) {
ContainerInfo entity = new ContainerInfo( //
cursor.getLong(offset + 0), // _id
cursor.getFloat(offset + 1), // qty
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name
cursor.getInt(offset + 3), // id
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // locationCode
cursor.getInt(offset + 5), // receiptId
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6) // barcode
);
return entity;
}
@Override
public void readEntity(Cursor cursor, ContainerInfo entity, int offset) {
entity.set_id(cursor.getLong(offset + 0));
entity.setQty(cursor.getFloat(offset + 1));
entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setId(cursor.getInt(offset + 3));
entity.setLocationCode(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setReceiptId(cursor.getInt(offset + 5));
entity.setBarcode(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
}
@Override
protected final Long updateKeyAfterInsert(ContainerInfo entity, long rowId) {
entity.set_id(rowId);
return rowId;
}
@Override
public Long getKey(ContainerInfo entity) {
if(entity != null) {
return entity.get_id();
} else {
return null;
}
}
@Override
public boolean hasKey(ContainerInfo entity) {
throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}