LineBeanDao.java 8.93 KB
package com.huaheng.robot.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.robot.bean.LineBean;

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

    public static final String TABLENAME = "LINE_BEAN";

    /**
     * Properties of entity LineBean.<br/>
     * Can be used for QueryBuilder and for referencing column names.
     */
    public static class Properties {
        public final static Property Code = new Property(0, String.class, "code", false, "CODE");
        public final static Property Name = new Property(1, String.class, "name", false, "NAME");
        public final static Property Locations = new Property(2, String.class, "locations", false, "LOCATIONS");
        public final static Property ChargingPiles = new Property(3, String.class, "chargingPiles", false, "CHARGING_PILES");
        public final static Property ActivityIslands = new Property(4, String.class, "activityIslands", false, "ACTIVITY_ISLANDS");
        public final static Property WorkProcess = new Property(5, String.class, "workProcess", false, "WORK_PROCESS");
        public final static Property Id = new Property(6, int.class, "id", false, "ID");
        public final static Property Created = new Property(7, String.class, "created", false, "CREATED");
        public final static Property CreatedBy = new Property(8, String.class, "createdBy", false, "CREATED_BY");
        public final static Property Updated = new Property(9, String.class, "updated", false, "UPDATED");
        public final static Property UpdatedBy = new Property(10, String.class, "updatedBy", false, "UPDATED_BY");
    }


    public LineBeanDao(DaoConfig config) {
        super(config);
    }
    
    public LineBeanDao(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 + "\"LINE_BEAN\" (" + //
                "\"CODE\" TEXT," + // 0: code
                "\"NAME\" TEXT," + // 1: name
                "\"LOCATIONS\" TEXT," + // 2: locations
                "\"CHARGING_PILES\" TEXT," + // 3: chargingPiles
                "\"ACTIVITY_ISLANDS\" TEXT," + // 4: activityIslands
                "\"WORK_PROCESS\" TEXT," + // 5: workProcess
                "\"ID\" INTEGER NOT NULL ," + // 6: id
                "\"CREATED\" TEXT," + // 7: created
                "\"CREATED_BY\" TEXT," + // 8: createdBy
                "\"UPDATED\" TEXT," + // 9: updated
                "\"UPDATED_BY\" TEXT);"); // 10: updatedBy
    }

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

    @Override
    protected final void bindValues(DatabaseStatement stmt, LineBean entity) {
        stmt.clearBindings();
 
        String code = entity.getCode();
        if (code != null) {
            stmt.bindString(1, code);
        }
 
        String name = entity.getName();
        if (name != null) {
            stmt.bindString(2, name);
        }
 
        String locations = entity.getLocations();
        if (locations != null) {
            stmt.bindString(3, locations);
        }
 
        String chargingPiles = entity.getChargingPiles();
        if (chargingPiles != null) {
            stmt.bindString(4, chargingPiles);
        }
 
        String activityIslands = entity.getActivityIslands();
        if (activityIslands != null) {
            stmt.bindString(5, activityIslands);
        }
 
        String workProcess = entity.getWorkProcess();
        if (workProcess != null) {
            stmt.bindString(6, workProcess);
        }
        stmt.bindLong(7, entity.getId());
 
        String created = entity.getCreated();
        if (created != null) {
            stmt.bindString(8, created);
        }
 
        String createdBy = entity.getCreatedBy();
        if (createdBy != null) {
            stmt.bindString(9, createdBy);
        }
 
        String updated = entity.getUpdated();
        if (updated != null) {
            stmt.bindString(10, updated);
        }
 
        String updatedBy = entity.getUpdatedBy();
        if (updatedBy != null) {
            stmt.bindString(11, updatedBy);
        }
    }

    @Override
    protected final void bindValues(SQLiteStatement stmt, LineBean entity) {
        stmt.clearBindings();
 
        String code = entity.getCode();
        if (code != null) {
            stmt.bindString(1, code);
        }
 
        String name = entity.getName();
        if (name != null) {
            stmt.bindString(2, name);
        }
 
        String locations = entity.getLocations();
        if (locations != null) {
            stmt.bindString(3, locations);
        }
 
        String chargingPiles = entity.getChargingPiles();
        if (chargingPiles != null) {
            stmt.bindString(4, chargingPiles);
        }
 
        String activityIslands = entity.getActivityIslands();
        if (activityIslands != null) {
            stmt.bindString(5, activityIslands);
        }
 
        String workProcess = entity.getWorkProcess();
        if (workProcess != null) {
            stmt.bindString(6, workProcess);
        }
        stmt.bindLong(7, entity.getId());
 
        String created = entity.getCreated();
        if (created != null) {
            stmt.bindString(8, created);
        }
 
        String createdBy = entity.getCreatedBy();
        if (createdBy != null) {
            stmt.bindString(9, createdBy);
        }
 
        String updated = entity.getUpdated();
        if (updated != null) {
            stmt.bindString(10, updated);
        }
 
        String updatedBy = entity.getUpdatedBy();
        if (updatedBy != null) {
            stmt.bindString(11, updatedBy);
        }
    }

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

    @Override
    public LineBean readEntity(Cursor cursor, int offset) {
        LineBean entity = new LineBean( //
            cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // code
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // name
            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // locations
            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // chargingPiles
            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // activityIslands
            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // workProcess
            cursor.getInt(offset + 6), // id
            cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // created
            cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // createdBy
            cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // updated
            cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // updatedBy
        );
        return entity;
    }
     
    @Override
    public void readEntity(Cursor cursor, LineBean entity, int offset) {
        entity.setCode(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
        entity.setName(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
        entity.setLocations(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
        entity.setChargingPiles(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
        entity.setActivityIslands(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
        entity.setWorkProcess(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
        entity.setId(cursor.getInt(offset + 6));
        entity.setCreated(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
        entity.setCreatedBy(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
        entity.setUpdated(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
        entity.setUpdatedBy(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
     }
    
    @Override
    protected final Void updateKeyAfterInsert(LineBean entity, long rowId) {
        // Unsupported or missing PK type
        return null;
    }
    
    @Override
    public Void getKey(LineBean entity) {
        return null;
    }

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

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