陈力
2023-05-27 3cbf0a380d302bf1cf8d7e4aa4ff36d5dbb90adb
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
package com.lotaai.canguiayw.sqllitedb;
 
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 "TEST".
*/
public class TestDao extends AbstractDao<Test, Void> {
 
    public static final String TABLENAME = "TEST";
 
    /**
     * Properties of entity Test.<br/>
     * Can be used for QueryBuilder and for referencing column names.
     */
    public static class Properties {
        public final static Property BarCode = new Property(0, String.class, "barCode", false, "BAR_CODE");
        public final static Property ETageCode = new Property(1, String.class, "eTageCode", false, "E_TAGE_CODE");
    }
 
 
    public TestDao(DaoConfig config) {
        super(config);
    }
    
    public TestDao(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 + "\"TEST\" (" + //
                "\"BAR_CODE\" TEXT UNIQUE ," + // 0: barCode
                "\"E_TAGE_CODE\" TEXT NOT NULL );"); // 1: eTageCode
    }
 
    /** Drops the underlying database table. */
    public static void dropTable(Database db, boolean ifExists) {
        String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TEST\"";
        db.execSQL(sql);
    }
 
    @Override
    protected final void bindValues(DatabaseStatement stmt, Test entity) {
        stmt.clearBindings();
 
        String barCode = entity.getBarCode();
        if (barCode != null) {
            stmt.bindString(1, barCode);
        }
        stmt.bindString(2, entity.getETageCode());
    }
 
    @Override
    protected final void bindValues(SQLiteStatement stmt, Test entity) {
        stmt.clearBindings();
 
        String barCode = entity.getBarCode();
        if (barCode != null) {
            stmt.bindString(1, barCode);
        }
        stmt.bindString(2, entity.getETageCode());
    }
 
    @Override
    public Void readKey(Cursor cursor, int offset) {
        return null;
    }    
 
    @Override
    public Test readEntity(Cursor cursor, int offset) {
        Test entity = new Test( //
            cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // barCode
            cursor.getString(offset + 1) // eTageCode
        );
        return entity;
    }
     
    @Override
    public void readEntity(Cursor cursor, Test entity, int offset) {
        entity.setBarCode(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
        entity.setETageCode(cursor.getString(offset + 1));
     }
    
    @Override
    protected final Void updateKeyAfterInsert(Test entity, long rowId) {
        // Unsupported or missing PK type
        return null;
    }
    
    @Override
    public Void getKey(Test entity) {
        return null;
    }
 
    @Override
    public boolean hasKey(Test entity) {
        // TODO
        return false;
    }
 
    @Override
    protected final boolean isEntityUpdateable() {
        return true;
    }
    
}