WorkProcessBeanDao.java 9.34 KB
package com.lijinji.scan.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.scan.bean.WorkProcessBean;

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

    public static final String TABLENAME = "WORK_PROCESS_BEAN";

    /**
     * Properties of entity WorkProcessBean.<br/>
     * Can be used for QueryBuilder and for referencing column names.
     */
    public static class Properties {
        public final static Property LineId = new Property(0, int.class, "lineId", false, "LINE_ID");
        public final static Property LineCode = new Property(1, String.class, "lineCode", false, "LINE_CODE");
        public final static Property Code = new Property(2, String.class, "code", false, "CODE");
        public final static Property Name = new Property(3, String.class, "name", false, "NAME");
        public final static Property Remark = new Property(4, String.class, "remark", false, "REMARK");
        public final static Property LineEntity = new Property(5, String.class, "lineEntity", false, "LINE_ENTITY");
        public final static Property WorkProcessDetails = new Property(6, String.class, "workProcessDetails", false, "WORK_PROCESS_DETAILS");
        public final static Property Id = new Property(7, int.class, "id", false, "ID");
        public final static Property Created = new Property(8, String.class, "created", false, "CREATED");
        public final static Property CreatedBy = new Property(9, String.class, "createdBy", false, "CREATED_BY");
        public final static Property Updated = new Property(10, String.class, "updated", false, "UPDATED");
        public final static Property UpdatedBy = new Property(11, String.class, "updatedBy", false, "UPDATED_BY");
    }


    public WorkProcessBeanDao(DaoConfig config) {
        super(config);
    }
    
    public WorkProcessBeanDao(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 + "\"WORK_PROCESS_BEAN\" (" + //
                "\"LINE_ID\" INTEGER NOT NULL ," + // 0: lineId
                "\"LINE_CODE\" TEXT," + // 1: lineCode
                "\"CODE\" TEXT," + // 2: code
                "\"NAME\" TEXT," + // 3: name
                "\"REMARK\" TEXT," + // 4: remark
                "\"LINE_ENTITY\" TEXT," + // 5: lineEntity
                "\"WORK_PROCESS_DETAILS\" TEXT," + // 6: workProcessDetails
                "\"ID\" INTEGER NOT NULL ," + // 7: id
                "\"CREATED\" TEXT," + // 8: created
                "\"CREATED_BY\" TEXT," + // 9: createdBy
                "\"UPDATED\" TEXT," + // 10: updated
                "\"UPDATED_BY\" TEXT);"); // 11: updatedBy
    }

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

    @Override
    protected final void bindValues(DatabaseStatement stmt, WorkProcessBean entity) {
        stmt.clearBindings();
        stmt.bindLong(1, entity.getLineId());
 
        String lineCode = entity.getLineCode();
        if (lineCode != null) {
            stmt.bindString(2, lineCode);
        }
 
        String code = entity.getCode();
        if (code != null) {
            stmt.bindString(3, code);
        }
 
        String name = entity.getName();
        if (name != null) {
            stmt.bindString(4, name);
        }
 
        String remark = entity.getRemark();
        if (remark != null) {
            stmt.bindString(5, remark);
        }
 
        String lineEntity = entity.getLineEntity();
        if (lineEntity != null) {
            stmt.bindString(6, lineEntity);
        }
 
        String workProcessDetails = entity.getWorkProcessDetails();
        if (workProcessDetails != null) {
            stmt.bindString(7, workProcessDetails);
        }
        stmt.bindLong(8, entity.getId());
 
        String created = entity.getCreated();
        if (created != null) {
            stmt.bindString(9, created);
        }
 
        String createdBy = entity.getCreatedBy();
        if (createdBy != null) {
            stmt.bindString(10, createdBy);
        }
 
        String updated = entity.getUpdated();
        if (updated != null) {
            stmt.bindString(11, updated);
        }
 
        String updatedBy = entity.getUpdatedBy();
        if (updatedBy != null) {
            stmt.bindString(12, updatedBy);
        }
    }

    @Override
    protected final void bindValues(SQLiteStatement stmt, WorkProcessBean entity) {
        stmt.clearBindings();
        stmt.bindLong(1, entity.getLineId());
 
        String lineCode = entity.getLineCode();
        if (lineCode != null) {
            stmt.bindString(2, lineCode);
        }
 
        String code = entity.getCode();
        if (code != null) {
            stmt.bindString(3, code);
        }
 
        String name = entity.getName();
        if (name != null) {
            stmt.bindString(4, name);
        }
 
        String remark = entity.getRemark();
        if (remark != null) {
            stmt.bindString(5, remark);
        }
 
        String lineEntity = entity.getLineEntity();
        if (lineEntity != null) {
            stmt.bindString(6, lineEntity);
        }
 
        String workProcessDetails = entity.getWorkProcessDetails();
        if (workProcessDetails != null) {
            stmt.bindString(7, workProcessDetails);
        }
        stmt.bindLong(8, entity.getId());
 
        String created = entity.getCreated();
        if (created != null) {
            stmt.bindString(9, created);
        }
 
        String createdBy = entity.getCreatedBy();
        if (createdBy != null) {
            stmt.bindString(10, createdBy);
        }
 
        String updated = entity.getUpdated();
        if (updated != null) {
            stmt.bindString(11, updated);
        }
 
        String updatedBy = entity.getUpdatedBy();
        if (updatedBy != null) {
            stmt.bindString(12, updatedBy);
        }
    }

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

    @Override
    public WorkProcessBean readEntity(Cursor cursor, int offset) {
        WorkProcessBean entity = new WorkProcessBean( //
            cursor.getInt(offset + 0), // lineId
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // lineCode
            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code
            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // name
            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // remark
            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // lineEntity
            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // workProcessDetails
            cursor.getInt(offset + 7), // id
            cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // created
            cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // createdBy
            cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // updated
            cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11) // updatedBy
        );
        return entity;
    }
     
    @Override
    public void readEntity(Cursor cursor, WorkProcessBean entity, int offset) {
        entity.setLineId(cursor.getInt(offset + 0));
        entity.setLineCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
        entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
        entity.setName(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
        entity.setRemark(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
        entity.setLineEntity(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
        entity.setWorkProcessDetails(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
        entity.setId(cursor.getInt(offset + 7));
        entity.setCreated(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
        entity.setCreatedBy(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
        entity.setUpdated(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
        entity.setUpdatedBy(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
     }
    
    @Override
    protected final Void updateKeyAfterInsert(WorkProcessBean entity, long rowId) {
        // Unsupported or missing PK type
        return null;
    }
    
    @Override
    public Void getKey(WorkProcessBean entity) {
        return null;
    }

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

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