ActivityIslandBeanDao.java 15 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.LineBean;
import com.lijinji.part.bean.LocationBean;
import com.lijinji.part.bean.WorkProcessDetailBean;
import com.lijinji.part.bean.convert.LineConvert;
import com.lijinji.part.bean.convert.LocationConvert;
import com.lijinji.part.bean.convert.WorkProcessDetailConvert;

import com.lijinji.part.bean.ActivityIslandBean;

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

    public static final String TABLENAME = "ACTIVITY_ISLAND_BEAN";

    /**
     * Properties of entity ActivityIslandBean.<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 LocationId = new Property(2, int.class, "locationId", false, "LOCATION_ID");
        public final static Property LocationCode = new Property(3, String.class, "locationCode", false, "LOCATION_CODE");
        public final static Property WorkProcessDetailId = new Property(4, int.class, "workProcessDetailId", false, "WORK_PROCESS_DETAIL_ID");
        public final static Property WorkProcessDetailCode = new Property(5, String.class, "workProcessDetailCode", false, "WORK_PROCESS_DETAIL_CODE");
        public final static Property Code = new Property(6, String.class, "code", false, "CODE");
        public final static Property Name = new Property(7, String.class, "name", false, "NAME");
        public final static Property Direction = new Property(8, int.class, "direction", false, "DIRECTION");
        public final static Property Status = new Property(9, int.class, "status", false, "STATUS");
        public final static Property SignalStatus = new Property(10, int.class, "signalStatus", false, "SIGNAL_STATUS");
        public final static Property Disable = new Property(11, boolean.class, "disable", false, "DISABLE");
        public final static Property Remark = new Property(12, String.class, "remark", false, "REMARK");
        public final static Property LineEntity = new Property(13, String.class, "lineEntity", false, "LINE_ENTITY");
        public final static Property Location = new Property(14, String.class, "location", false, "LOCATION");
        public final static Property WorkProcessDetail = new Property(15, String.class, "workProcessDetail", false, "WORK_PROCESS_DETAIL");
        public final static Property Id = new Property(16, int.class, "id", false, "ID");
        public final static Property Created = new Property(17, String.class, "created", false, "CREATED");
        public final static Property CreatedBy = new Property(18, String.class, "createdBy", false, "CREATED_BY");
        public final static Property Updated = new Property(19, String.class, "updated", false, "UPDATED");
        public final static Property UpdatedBy = new Property(20, String.class, "updatedBy", false, "UPDATED_BY");
    }

    private final LineConvert lineEntityConverter = new LineConvert();
    private final LocationConvert locationConverter = new LocationConvert();
    private final WorkProcessDetailConvert workProcessDetailConverter = new WorkProcessDetailConvert();

    public ActivityIslandBeanDao(DaoConfig config) {
        super(config);
    }
    
    public ActivityIslandBeanDao(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 + "\"ACTIVITY_ISLAND_BEAN\" (" + //
                "\"LINE_ID\" INTEGER NOT NULL ," + // 0: lineId
                "\"LINE_CODE\" TEXT," + // 1: lineCode
                "\"LOCATION_ID\" INTEGER NOT NULL ," + // 2: locationId
                "\"LOCATION_CODE\" TEXT," + // 3: locationCode
                "\"WORK_PROCESS_DETAIL_ID\" INTEGER NOT NULL ," + // 4: workProcessDetailId
                "\"WORK_PROCESS_DETAIL_CODE\" TEXT," + // 5: workProcessDetailCode
                "\"CODE\" TEXT," + // 6: code
                "\"NAME\" TEXT," + // 7: name
                "\"DIRECTION\" INTEGER NOT NULL ," + // 8: direction
                "\"STATUS\" INTEGER NOT NULL ," + // 9: status
                "\"SIGNAL_STATUS\" INTEGER NOT NULL ," + // 10: signalStatus
                "\"DISABLE\" INTEGER NOT NULL ," + // 11: disable
                "\"REMARK\" TEXT," + // 12: remark
                "\"LINE_ENTITY\" TEXT," + // 13: lineEntity
                "\"LOCATION\" TEXT," + // 14: location
                "\"WORK_PROCESS_DETAIL\" TEXT," + // 15: workProcessDetail
                "\"ID\" INTEGER NOT NULL ," + // 16: id
                "\"CREATED\" TEXT," + // 17: created
                "\"CREATED_BY\" TEXT," + // 18: createdBy
                "\"UPDATED\" TEXT," + // 19: updated
                "\"UPDATED_BY\" TEXT);"); // 20: updatedBy
    }

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

    @Override
    protected final void bindValues(DatabaseStatement stmt, ActivityIslandBean entity) {
        stmt.clearBindings();
        stmt.bindLong(1, entity.getLineId());
 
        String lineCode = entity.getLineCode();
        if (lineCode != null) {
            stmt.bindString(2, lineCode);
        }
        stmt.bindLong(3, entity.getLocationId());
 
        String locationCode = entity.getLocationCode();
        if (locationCode != null) {
            stmt.bindString(4, locationCode);
        }
        stmt.bindLong(5, entity.getWorkProcessDetailId());
 
        String workProcessDetailCode = entity.getWorkProcessDetailCode();
        if (workProcessDetailCode != null) {
            stmt.bindString(6, workProcessDetailCode);
        }
 
        String code = entity.getCode();
        if (code != null) {
            stmt.bindString(7, code);
        }
 
        String name = entity.getName();
        if (name != null) {
            stmt.bindString(8, name);
        }
        stmt.bindLong(9, entity.getDirection());
        stmt.bindLong(10, entity.getStatus());
        stmt.bindLong(11, entity.getSignalStatus());
        stmt.bindLong(12, entity.getDisable() ? 1L: 0L);
 
        String remark = entity.getRemark();
        if (remark != null) {
            stmt.bindString(13, remark);
        }
 
        LineBean lineEntity = entity.getLineEntity();
        if (lineEntity != null) {
            stmt.bindString(14, lineEntityConverter.convertToDatabaseValue(lineEntity));
        }
 
        LocationBean location = entity.getLocation();
        if (location != null) {
            stmt.bindString(15, locationConverter.convertToDatabaseValue(location));
        }
 
        WorkProcessDetailBean workProcessDetail = entity.getWorkProcessDetail();
        if (workProcessDetail != null) {
            stmt.bindString(16, workProcessDetailConverter.convertToDatabaseValue(workProcessDetail));
        }
        stmt.bindLong(17, entity.getId());
 
        String created = entity.getCreated();
        if (created != null) {
            stmt.bindString(18, created);
        }
 
        String createdBy = entity.getCreatedBy();
        if (createdBy != null) {
            stmt.bindString(19, createdBy);
        }
 
        String updated = entity.getUpdated();
        if (updated != null) {
            stmt.bindString(20, updated);
        }
 
        String updatedBy = entity.getUpdatedBy();
        if (updatedBy != null) {
            stmt.bindString(21, updatedBy);
        }
    }

    @Override
    protected final void bindValues(SQLiteStatement stmt, ActivityIslandBean entity) {
        stmt.clearBindings();
        stmt.bindLong(1, entity.getLineId());
 
        String lineCode = entity.getLineCode();
        if (lineCode != null) {
            stmt.bindString(2, lineCode);
        }
        stmt.bindLong(3, entity.getLocationId());
 
        String locationCode = entity.getLocationCode();
        if (locationCode != null) {
            stmt.bindString(4, locationCode);
        }
        stmt.bindLong(5, entity.getWorkProcessDetailId());
 
        String workProcessDetailCode = entity.getWorkProcessDetailCode();
        if (workProcessDetailCode != null) {
            stmt.bindString(6, workProcessDetailCode);
        }
 
        String code = entity.getCode();
        if (code != null) {
            stmt.bindString(7, code);
        }
 
        String name = entity.getName();
        if (name != null) {
            stmt.bindString(8, name);
        }
        stmt.bindLong(9, entity.getDirection());
        stmt.bindLong(10, entity.getStatus());
        stmt.bindLong(11, entity.getSignalStatus());
        stmt.bindLong(12, entity.getDisable() ? 1L: 0L);
 
        String remark = entity.getRemark();
        if (remark != null) {
            stmt.bindString(13, remark);
        }
 
        LineBean lineEntity = entity.getLineEntity();
        if (lineEntity != null) {
            stmt.bindString(14, lineEntityConverter.convertToDatabaseValue(lineEntity));
        }
 
        LocationBean location = entity.getLocation();
        if (location != null) {
            stmt.bindString(15, locationConverter.convertToDatabaseValue(location));
        }
 
        WorkProcessDetailBean workProcessDetail = entity.getWorkProcessDetail();
        if (workProcessDetail != null) {
            stmt.bindString(16, workProcessDetailConverter.convertToDatabaseValue(workProcessDetail));
        }
        stmt.bindLong(17, entity.getId());
 
        String created = entity.getCreated();
        if (created != null) {
            stmt.bindString(18, created);
        }
 
        String createdBy = entity.getCreatedBy();
        if (createdBy != null) {
            stmt.bindString(19, createdBy);
        }
 
        String updated = entity.getUpdated();
        if (updated != null) {
            stmt.bindString(20, updated);
        }
 
        String updatedBy = entity.getUpdatedBy();
        if (updatedBy != null) {
            stmt.bindString(21, updatedBy);
        }
    }

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

    @Override
    public ActivityIslandBean readEntity(Cursor cursor, int offset) {
        ActivityIslandBean entity = new ActivityIslandBean( //
            cursor.getInt(offset + 0), // lineId
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // lineCode
            cursor.getInt(offset + 2), // locationId
            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // locationCode
            cursor.getInt(offset + 4), // workProcessDetailId
            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // workProcessDetailCode
            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // code
            cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // name
            cursor.getInt(offset + 8), // direction
            cursor.getInt(offset + 9), // status
            cursor.getInt(offset + 10), // signalStatus
            cursor.getShort(offset + 11) != 0, // disable
            cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // remark
            cursor.isNull(offset + 13) ? null : lineEntityConverter.convertToEntityProperty(cursor.getString(offset + 13)), // lineEntity
            cursor.isNull(offset + 14) ? null : locationConverter.convertToEntityProperty(cursor.getString(offset + 14)), // location
            cursor.isNull(offset + 15) ? null : workProcessDetailConverter.convertToEntityProperty(cursor.getString(offset + 15)), // workProcessDetail
            cursor.getInt(offset + 16), // id
            cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // created
            cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // createdBy
            cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // updated
            cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20) // updatedBy
        );
        return entity;
    }
     
    @Override
    public void readEntity(Cursor cursor, ActivityIslandBean entity, int offset) {
        entity.setLineId(cursor.getInt(offset + 0));
        entity.setLineCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
        entity.setLocationId(cursor.getInt(offset + 2));
        entity.setLocationCode(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
        entity.setWorkProcessDetailId(cursor.getInt(offset + 4));
        entity.setWorkProcessDetailCode(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
        entity.setCode(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
        entity.setName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
        entity.setDirection(cursor.getInt(offset + 8));
        entity.setStatus(cursor.getInt(offset + 9));
        entity.setSignalStatus(cursor.getInt(offset + 10));
        entity.setDisable(cursor.getShort(offset + 11) != 0);
        entity.setRemark(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
        entity.setLineEntity(cursor.isNull(offset + 13) ? null : lineEntityConverter.convertToEntityProperty(cursor.getString(offset + 13)));
        entity.setLocation(cursor.isNull(offset + 14) ? null : locationConverter.convertToEntityProperty(cursor.getString(offset + 14)));
        entity.setWorkProcessDetail(cursor.isNull(offset + 15) ? null : workProcessDetailConverter.convertToEntityProperty(cursor.getString(offset + 15)));
        entity.setId(cursor.getInt(offset + 16));
        entity.setCreated(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
        entity.setCreatedBy(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
        entity.setUpdated(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
        entity.setUpdatedBy(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
     }
    
    @Override
    protected final Void updateKeyAfterInsert(ActivityIslandBean entity, long rowId) {
        // Unsupported or missing PK type
        return null;
    }
    
    @Override
    public Void getKey(ActivityIslandBean entity) {
        return null;
    }

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

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