PartBeanDao.java 15.3 KB
package com.lijinji.part.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.lijinji.part.bean.PartBean;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/** 
 * DAO for table "PART_BEAN".
*/
public class PartBeanDao extends AbstractDao<PartBean, Void> {

    public static final String TABLENAME = "PART_BEAN";

    /**
     * Properties of entity PartBean.<br/>
     * Can be used for QueryBuilder and for referencing column names.
     */
    public static class Properties {
        public final static Property PartMaterialCode = new Property(0, String.class, "partMaterialCode", false, "PART_MATERIAL_CODE");
        public final static Property PartMaterialDesc = new Property(1, String.class, "partMaterialDesc", false, "PART_MATERIAL_DESC");
        public final static Property PartUnit = new Property(2, String.class, "partUnit", false, "PART_UNIT");
        public final static Property LineNumber = new Property(3, String.class, "lineNumber", false, "LINE_NUMBER");
        public final static Property Qty = new Property(4, String.class, "qty", false, "QTY");
        public final static Property PalletQty = new Property(5, String.class, "palletQty", false, "PALLET_QTY");
        public final static Property Batch = new Property(6, String.class, "batch", false, "BATCH");
        public final static Property Date = new Property(7, String.class, "date", false, "DATE");
        public final static Property BillNo = new Property(8, String.class, "billNo", false, "BILL_NO");
        public final static Property RowItem = new Property(9, String.class, "rowItem", false, "ROW_ITEM");
        public final static Property LockId = new Property(10, String.class, "lockId", false, "LOCK_ID");
        public final static Property Priority = new Property(11, int.class, "priority", false, "PRIORITY");
        public final static Property Status = new Property(12, int.class, "status", false, "STATUS");
        public final static Property GeneralType = new Property(13, int.class, "generalType", false, "GENERAL_TYPE");
        public final static Property LineCode = new Property(14, String.class, "lineCode", false, "LINE_CODE");
        public final static Property Disable = new Property(15, boolean.class, "disable", false, "DISABLE");
        public final static Property FinishedPalletQty = new Property(16, int.class, "finishedPalletQty", false, "FINISHED_PALLET_QTY");
        public final static Property OnlinePalletQty = new Property(17, int.class, "onlinePalletQty", false, "ONLINE_PALLET_QTY");
        public final static Property SynPalletQty = new Property(18, int.class, "synPalletQty", false, "SYN_PALLET_QTY");
        public final static Property Id = new Property(19, int.class, "id", false, "ID");
        public final static Property Created = new Property(20, String.class, "created", false, "CREATED");
        public final static Property CreatedBy = new Property(21, String.class, "createdBy", false, "CREATED_BY");
        public final static Property Updated = new Property(22, String.class, "updated", false, "UPDATED");
        public final static Property UpdatedBy = new Property(23, String.class, "updatedBy", false, "UPDATED_BY");
    }


    public PartBeanDao(DaoConfig config) {
        super(config);
    }
    
    public PartBeanDao(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 + "\"PART_BEAN\" (" + //
                "\"PART_MATERIAL_CODE\" TEXT," + // 0: partMaterialCode
                "\"PART_MATERIAL_DESC\" TEXT," + // 1: partMaterialDesc
                "\"PART_UNIT\" TEXT," + // 2: partUnit
                "\"LINE_NUMBER\" TEXT," + // 3: lineNumber
                "\"QTY\" TEXT," + // 4: qty
                "\"PALLET_QTY\" TEXT," + // 5: palletQty
                "\"BATCH\" TEXT," + // 6: batch
                "\"DATE\" TEXT," + // 7: date
                "\"BILL_NO\" TEXT," + // 8: billNo
                "\"ROW_ITEM\" TEXT," + // 9: rowItem
                "\"LOCK_ID\" TEXT," + // 10: lockId
                "\"PRIORITY\" INTEGER NOT NULL ," + // 11: priority
                "\"STATUS\" INTEGER NOT NULL ," + // 12: status
                "\"GENERAL_TYPE\" INTEGER NOT NULL ," + // 13: generalType
                "\"LINE_CODE\" TEXT," + // 14: lineCode
                "\"DISABLE\" INTEGER NOT NULL ," + // 15: disable
                "\"FINISHED_PALLET_QTY\" INTEGER NOT NULL ," + // 16: finishedPalletQty
                "\"ONLINE_PALLET_QTY\" INTEGER NOT NULL ," + // 17: onlinePalletQty
                "\"SYN_PALLET_QTY\" INTEGER NOT NULL ," + // 18: synPalletQty
                "\"ID\" INTEGER NOT NULL ," + // 19: id
                "\"CREATED\" TEXT," + // 20: created
                "\"CREATED_BY\" TEXT," + // 21: createdBy
                "\"UPDATED\" TEXT," + // 22: updated
                "\"UPDATED_BY\" TEXT);"); // 23: updatedBy
    }

    /** Drops the underlying database table. */
    public static void dropTable(Database db, boolean ifExists) {
        String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PART_BEAN\"";
        db.execSQL(sql);
    }

    @Override
    protected final void bindValues(DatabaseStatement stmt, PartBean entity) {
        stmt.clearBindings();
 
        String partMaterialCode = entity.getPartMaterialCode();
        if (partMaterialCode != null) {
            stmt.bindString(1, partMaterialCode);
        }
 
        String partMaterialDesc = entity.getPartMaterialDesc();
        if (partMaterialDesc != null) {
            stmt.bindString(2, partMaterialDesc);
        }
 
        String partUnit = entity.getPartUnit();
        if (partUnit != null) {
            stmt.bindString(3, partUnit);
        }
 
        String lineNumber = entity.getLineNumber();
        if (lineNumber != null) {
            stmt.bindString(4, lineNumber);
        }
 
        String qty = entity.getQty();
        if (qty != null) {
            stmt.bindString(5, qty);
        }
 
        String palletQty = entity.getPalletQty();
        if (palletQty != null) {
            stmt.bindString(6, palletQty);
        }
 
        String batch = entity.getBatch();
        if (batch != null) {
            stmt.bindString(7, batch);
        }
 
        String date = entity.getDate();
        if (date != null) {
            stmt.bindString(8, date);
        }
 
        String billNo = entity.getBillNo();
        if (billNo != null) {
            stmt.bindString(9, billNo);
        }
 
        String rowItem = entity.getRowItem();
        if (rowItem != null) {
            stmt.bindString(10, rowItem);
        }
 
        String lockId = entity.getLockId();
        if (lockId != null) {
            stmt.bindString(11, lockId);
        }
        stmt.bindLong(12, entity.getPriority());
        stmt.bindLong(13, entity.getStatus());
        stmt.bindLong(14, entity.getGeneralType());
 
        String lineCode = entity.getLineCode();
        if (lineCode != null) {
            stmt.bindString(15, lineCode);
        }
        stmt.bindLong(16, entity.getDisable() ? 1L: 0L);
        stmt.bindLong(17, entity.getFinishedPalletQty());
        stmt.bindLong(18, entity.getOnlinePalletQty());
        stmt.bindLong(19, entity.getSynPalletQty());
        stmt.bindLong(20, entity.getId());
 
        String created = entity.getCreated();
        if (created != null) {
            stmt.bindString(21, created);
        }
 
        String createdBy = entity.getCreatedBy();
        if (createdBy != null) {
            stmt.bindString(22, createdBy);
        }
 
        String updated = entity.getUpdated();
        if (updated != null) {
            stmt.bindString(23, updated);
        }
 
        String updatedBy = entity.getUpdatedBy();
        if (updatedBy != null) {
            stmt.bindString(24, updatedBy);
        }
    }

    @Override
    protected final void bindValues(SQLiteStatement stmt, PartBean entity) {
        stmt.clearBindings();
 
        String partMaterialCode = entity.getPartMaterialCode();
        if (partMaterialCode != null) {
            stmt.bindString(1, partMaterialCode);
        }
 
        String partMaterialDesc = entity.getPartMaterialDesc();
        if (partMaterialDesc != null) {
            stmt.bindString(2, partMaterialDesc);
        }
 
        String partUnit = entity.getPartUnit();
        if (partUnit != null) {
            stmt.bindString(3, partUnit);
        }
 
        String lineNumber = entity.getLineNumber();
        if (lineNumber != null) {
            stmt.bindString(4, lineNumber);
        }
 
        String qty = entity.getQty();
        if (qty != null) {
            stmt.bindString(5, qty);
        }
 
        String palletQty = entity.getPalletQty();
        if (palletQty != null) {
            stmt.bindString(6, palletQty);
        }
 
        String batch = entity.getBatch();
        if (batch != null) {
            stmt.bindString(7, batch);
        }
 
        String date = entity.getDate();
        if (date != null) {
            stmt.bindString(8, date);
        }
 
        String billNo = entity.getBillNo();
        if (billNo != null) {
            stmt.bindString(9, billNo);
        }
 
        String rowItem = entity.getRowItem();
        if (rowItem != null) {
            stmt.bindString(10, rowItem);
        }
 
        String lockId = entity.getLockId();
        if (lockId != null) {
            stmt.bindString(11, lockId);
        }
        stmt.bindLong(12, entity.getPriority());
        stmt.bindLong(13, entity.getStatus());
        stmt.bindLong(14, entity.getGeneralType());
 
        String lineCode = entity.getLineCode();
        if (lineCode != null) {
            stmt.bindString(15, lineCode);
        }
        stmt.bindLong(16, entity.getDisable() ? 1L: 0L);
        stmt.bindLong(17, entity.getFinishedPalletQty());
        stmt.bindLong(18, entity.getOnlinePalletQty());
        stmt.bindLong(19, entity.getSynPalletQty());
        stmt.bindLong(20, entity.getId());
 
        String created = entity.getCreated();
        if (created != null) {
            stmt.bindString(21, created);
        }
 
        String createdBy = entity.getCreatedBy();
        if (createdBy != null) {
            stmt.bindString(22, createdBy);
        }
 
        String updated = entity.getUpdated();
        if (updated != null) {
            stmt.bindString(23, updated);
        }
 
        String updatedBy = entity.getUpdatedBy();
        if (updatedBy != null) {
            stmt.bindString(24, updatedBy);
        }
    }

    @Override
    public Void readKey(Cursor cursor, int offset) {
        return null;
    }    

    @Override
    public PartBean readEntity(Cursor cursor, int offset) {
        PartBean entity = new PartBean( //
            cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // partMaterialCode
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // partMaterialDesc
            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // partUnit
            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lineNumber
            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // qty
            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // palletQty
            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // batch
            cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // date
            cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // billNo
            cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // rowItem
            cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // lockId
            cursor.getInt(offset + 11), // priority
            cursor.getInt(offset + 12), // status
            cursor.getInt(offset + 13), // generalType
            cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // lineCode
            cursor.getShort(offset + 15) != 0, // disable
            cursor.getInt(offset + 16), // finishedPalletQty
            cursor.getInt(offset + 17), // onlinePalletQty
            cursor.getInt(offset + 18), // synPalletQty
            cursor.getInt(offset + 19), // id
            cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // created
            cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // createdBy
            cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // updated
            cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23) // updatedBy
        );
        return entity;
    }
     
    @Override
    public void readEntity(Cursor cursor, PartBean entity, int offset) {
        entity.setPartMaterialCode(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
        entity.setPartMaterialDesc(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
        entity.setPartUnit(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
        entity.setLineNumber(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
        entity.setQty(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
        entity.setPalletQty(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
        entity.setBatch(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
        entity.setDate(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
        entity.setBillNo(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
        entity.setRowItem(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
        entity.setLockId(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
        entity.setPriority(cursor.getInt(offset + 11));
        entity.setStatus(cursor.getInt(offset + 12));
        entity.setGeneralType(cursor.getInt(offset + 13));
        entity.setLineCode(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
        entity.setDisable(cursor.getShort(offset + 15) != 0);
        entity.setFinishedPalletQty(cursor.getInt(offset + 16));
        entity.setOnlinePalletQty(cursor.getInt(offset + 17));
        entity.setSynPalletQty(cursor.getInt(offset + 18));
        entity.setId(cursor.getInt(offset + 19));
        entity.setCreated(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
        entity.setCreatedBy(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
        entity.setUpdated(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22));
        entity.setUpdatedBy(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23));
     }
    
    @Override
    protected final Void updateKeyAfterInsert(PartBean entity, long rowId) {
        // Unsupported or missing PK type
        return null;
    }
    
    @Override
    public Void getKey(PartBean entity) {
        return null;
    }

    @Override
    public boolean hasKey(PartBean entity) {
        // TODO
        return false;
    }

    @Override
    protected final boolean isEntityUpdateable() {
        return true;
    }
    
}