package com.casic.common.detector.gd.greendao;

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.casic.common.detector.gd.bean.MarkerLocalBean;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/** 
 * DAO for table "MARKER_LOCAL_BEAN".
*/
public class MarkerLocalBeanDao extends AbstractDao<MarkerLocalBean, Long> {

    public static final String TABLENAME = "MARKER_LOCAL_BEAN";

    /**
     * Properties of entity MarkerLocalBean.<br/>
     * Can be used for QueryBuilder and for referencing column names.
     */
    public static class Properties {
        public final static Property Id = new Property(0, Long.class, "id", true, "_id");
        public final static Property PipelineType = new Property(1, String.class, "pipelineType", false, "PIPELINE_TYPE");
        public final static Property PipelineDiameter = new Property(2, String.class, "pipelineDiameter", false, "PIPELINE_DIAMETER");
        public final static Property PipelineMaterial = new Property(3, String.class, "pipelineMaterial", false, "PIPELINE_MATERIAL");
        public final static Property BuryMethod = new Property(4, String.class, "buryMethod", false, "BURY_METHOD");
        public final static Property BuryDepth = new Property(5, String.class, "buryDepth", false, "BURY_DEPTH");
        public final static Property Area = new Property(6, String.class, "area", false, "AREA");
        public final static Property Line = new Property(7, String.class, "line", false, "LINE");
        public final static Property Road = new Property(8, String.class, "road", false, "ROAD");
        public final static Property ConstructTime = new Property(9, String.class, "constructTime", false, "CONSTRUCT_TIME");
        public final static Property Owner = new Property(10, String.class, "owner", false, "OWNER");
        public final static Property ObjectId = new Property(11, String.class, "objectId", false, "OBJECT_ID");
        public final static Property MarkerId = new Property(12, String.class, "markerId", false, "MARKER_ID");
        public final static Property MarkerType = new Property(13, String.class, "markerType", false, "MARKER_TYPE");
        public final static Property MarkerDepth = new Property(14, String.class, "markerDepth", false, "MARKER_DEPTH");
        public final static Property InstallationDept = new Property(15, String.class, "installationDept", false, "INSTALLATION_DEPT");
        public final static Property Lng = new Property(16, String.class, "lng", false, "LNG");
        public final static Property Lat = new Property(17, String.class, "lat", false, "LAT");
        public final static Property UpdateTime = new Property(18, String.class, "updateTime", false, "UPDATE_TIME");
        public final static Property Remark = new Property(19, String.class, "remark", false, "REMARK");
        public final static Property UnderlyingPipelineType = new Property(20, String.class, "underlyingPipelineType", false, "UNDERLYING_PIPELINE_TYPE");
        public final static Property UnderlyingPipelineDepth = new Property(21, String.class, "underlyingPipelineDepth", false, "UNDERLYING_PIPELINE_DEPTH");
        public final static Property UnderlyingPipelineDiameter = new Property(22, String.class, "underlyingPipelineDiameter", false, "UNDERLYING_PIPELINE_DIAMETER");
        public final static Property UnderlyingPipelineMaterial = new Property(23, String.class, "underlyingPipelineMaterial", false, "UNDERLYING_PIPELINE_MATERIAL");
        public final static Property ObjectType = new Property(24, String.class, "objectType", false, "OBJECT_TYPE");
        public final static Property Color = new Property(25, String.class, "color", false, "COLOR");
        public final static Property ImagePath = new Property(26, String.class, "imagePath", false, "IMAGE_PATH");
    }


    public MarkerLocalBeanDao(DaoConfig config) {
        super(config);
    }
    
    public MarkerLocalBeanDao(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 + "\"MARKER_LOCAL_BEAN\" (" + //
                "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
                "\"PIPELINE_TYPE\" TEXT," + // 1: pipelineType
                "\"PIPELINE_DIAMETER\" TEXT," + // 2: pipelineDiameter
                "\"PIPELINE_MATERIAL\" TEXT," + // 3: pipelineMaterial
                "\"BURY_METHOD\" TEXT," + // 4: buryMethod
                "\"BURY_DEPTH\" TEXT," + // 5: buryDepth
                "\"AREA\" TEXT," + // 6: area
                "\"LINE\" TEXT," + // 7: line
                "\"ROAD\" TEXT," + // 8: road
                "\"CONSTRUCT_TIME\" TEXT," + // 9: constructTime
                "\"OWNER\" TEXT," + // 10: owner
                "\"OBJECT_ID\" TEXT," + // 11: objectId
                "\"MARKER_ID\" TEXT," + // 12: markerId
                "\"MARKER_TYPE\" TEXT," + // 13: markerType
                "\"MARKER_DEPTH\" TEXT," + // 14: markerDepth
                "\"INSTALLATION_DEPT\" TEXT," + // 15: installationDept
                "\"LNG\" TEXT," + // 16: lng
                "\"LAT\" TEXT," + // 17: lat
                "\"UPDATE_TIME\" TEXT," + // 18: updateTime
                "\"REMARK\" TEXT," + // 19: remark
                "\"UNDERLYING_PIPELINE_TYPE\" TEXT," + // 20: underlyingPipelineType
                "\"UNDERLYING_PIPELINE_DEPTH\" TEXT," + // 21: underlyingPipelineDepth
                "\"UNDERLYING_PIPELINE_DIAMETER\" TEXT," + // 22: underlyingPipelineDiameter
                "\"UNDERLYING_PIPELINE_MATERIAL\" TEXT," + // 23: underlyingPipelineMaterial
                "\"OBJECT_TYPE\" TEXT," + // 24: objectType
                "\"COLOR\" TEXT," + // 25: color
                "\"IMAGE_PATH\" TEXT);"); // 26: imagePath
    }

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

    @Override
    protected final void bindValues(DatabaseStatement stmt, MarkerLocalBean entity) {
        stmt.clearBindings();
 
        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }
 
        String pipelineType = entity.getPipelineType();
        if (pipelineType != null) {
            stmt.bindString(2, pipelineType);
        }
 
        String pipelineDiameter = entity.getPipelineDiameter();
        if (pipelineDiameter != null) {
            stmt.bindString(3, pipelineDiameter);
        }
 
        String pipelineMaterial = entity.getPipelineMaterial();
        if (pipelineMaterial != null) {
            stmt.bindString(4, pipelineMaterial);
        }
 
        String buryMethod = entity.getBuryMethod();
        if (buryMethod != null) {
            stmt.bindString(5, buryMethod);
        }
 
        String buryDepth = entity.getBuryDepth();
        if (buryDepth != null) {
            stmt.bindString(6, buryDepth);
        }
 
        String area = entity.getArea();
        if (area != null) {
            stmt.bindString(7, area);
        }
 
        String line = entity.getLine();
        if (line != null) {
            stmt.bindString(8, line);
        }
 
        String road = entity.getRoad();
        if (road != null) {
            stmt.bindString(9, road);
        }
 
        String constructTime = entity.getConstructTime();
        if (constructTime != null) {
            stmt.bindString(10, constructTime);
        }
 
        String owner = entity.getOwner();
        if (owner != null) {
            stmt.bindString(11, owner);
        }
 
        String objectId = entity.getObjectId();
        if (objectId != null) {
            stmt.bindString(12, objectId);
        }
 
        String markerId = entity.getMarkerId();
        if (markerId != null) {
            stmt.bindString(13, markerId);
        }
 
        String markerType = entity.getMarkerType();
        if (markerType != null) {
            stmt.bindString(14, markerType);
        }
 
        String markerDepth = entity.getMarkerDepth();
        if (markerDepth != null) {
            stmt.bindString(15, markerDepth);
        }
 
        String installationDept = entity.getInstallationDept();
        if (installationDept != null) {
            stmt.bindString(16, installationDept);
        }
 
        String lng = entity.getLng();
        if (lng != null) {
            stmt.bindString(17, lng);
        }
 
        String lat = entity.getLat();
        if (lat != null) {
            stmt.bindString(18, lat);
        }
 
        String updateTime = entity.getUpdateTime();
        if (updateTime != null) {
            stmt.bindString(19, updateTime);
        }
 
        String remark = entity.getRemark();
        if (remark != null) {
            stmt.bindString(20, remark);
        }
 
        String underlyingPipelineType = entity.getUnderlyingPipelineType();
        if (underlyingPipelineType != null) {
            stmt.bindString(21, underlyingPipelineType);
        }
 
        String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth();
        if (underlyingPipelineDepth != null) {
            stmt.bindString(22, underlyingPipelineDepth);
        }
 
        String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter();
        if (underlyingPipelineDiameter != null) {
            stmt.bindString(23, underlyingPipelineDiameter);
        }
 
        String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial();
        if (underlyingPipelineMaterial != null) {
            stmt.bindString(24, underlyingPipelineMaterial);
        }
 
        String objectType = entity.getObjectType();
        if (objectType != null) {
            stmt.bindString(25, objectType);
        }
 
        String color = entity.getColor();
        if (color != null) {
            stmt.bindString(26, color);
        }
 
        String imagePath = entity.getImagePath();
        if (imagePath != null) {
            stmt.bindString(27, imagePath);
        }
    }

    @Override
    protected final void bindValues(SQLiteStatement stmt, MarkerLocalBean entity) {
        stmt.clearBindings();
 
        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }
 
        String pipelineType = entity.getPipelineType();
        if (pipelineType != null) {
            stmt.bindString(2, pipelineType);
        }
 
        String pipelineDiameter = entity.getPipelineDiameter();
        if (pipelineDiameter != null) {
            stmt.bindString(3, pipelineDiameter);
        }
 
        String pipelineMaterial = entity.getPipelineMaterial();
        if (pipelineMaterial != null) {
            stmt.bindString(4, pipelineMaterial);
        }
 
        String buryMethod = entity.getBuryMethod();
        if (buryMethod != null) {
            stmt.bindString(5, buryMethod);
        }
 
        String buryDepth = entity.getBuryDepth();
        if (buryDepth != null) {
            stmt.bindString(6, buryDepth);
        }
 
        String area = entity.getArea();
        if (area != null) {
            stmt.bindString(7, area);
        }
 
        String line = entity.getLine();
        if (line != null) {
            stmt.bindString(8, line);
        }
 
        String road = entity.getRoad();
        if (road != null) {
            stmt.bindString(9, road);
        }
 
        String constructTime = entity.getConstructTime();
        if (constructTime != null) {
            stmt.bindString(10, constructTime);
        }
 
        String owner = entity.getOwner();
        if (owner != null) {
            stmt.bindString(11, owner);
        }
 
        String objectId = entity.getObjectId();
        if (objectId != null) {
            stmt.bindString(12, objectId);
        }
 
        String markerId = entity.getMarkerId();
        if (markerId != null) {
            stmt.bindString(13, markerId);
        }
 
        String markerType = entity.getMarkerType();
        if (markerType != null) {
            stmt.bindString(14, markerType);
        }
 
        String markerDepth = entity.getMarkerDepth();
        if (markerDepth != null) {
            stmt.bindString(15, markerDepth);
        }
 
        String installationDept = entity.getInstallationDept();
        if (installationDept != null) {
            stmt.bindString(16, installationDept);
        }
 
        String lng = entity.getLng();
        if (lng != null) {
            stmt.bindString(17, lng);
        }
 
        String lat = entity.getLat();
        if (lat != null) {
            stmt.bindString(18, lat);
        }
 
        String updateTime = entity.getUpdateTime();
        if (updateTime != null) {
            stmt.bindString(19, updateTime);
        }
 
        String remark = entity.getRemark();
        if (remark != null) {
            stmt.bindString(20, remark);
        }
 
        String underlyingPipelineType = entity.getUnderlyingPipelineType();
        if (underlyingPipelineType != null) {
            stmt.bindString(21, underlyingPipelineType);
        }
 
        String underlyingPipelineDepth = entity.getUnderlyingPipelineDepth();
        if (underlyingPipelineDepth != null) {
            stmt.bindString(22, underlyingPipelineDepth);
        }
 
        String underlyingPipelineDiameter = entity.getUnderlyingPipelineDiameter();
        if (underlyingPipelineDiameter != null) {
            stmt.bindString(23, underlyingPipelineDiameter);
        }
 
        String underlyingPipelineMaterial = entity.getUnderlyingPipelineMaterial();
        if (underlyingPipelineMaterial != null) {
            stmt.bindString(24, underlyingPipelineMaterial);
        }
 
        String objectType = entity.getObjectType();
        if (objectType != null) {
            stmt.bindString(25, objectType);
        }
 
        String color = entity.getColor();
        if (color != null) {
            stmt.bindString(26, color);
        }
 
        String imagePath = entity.getImagePath();
        if (imagePath != null) {
            stmt.bindString(27, imagePath);
        }
    }

    @Override
    public Long readKey(Cursor cursor, int offset) {
        return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
    }    

    @Override
    public MarkerLocalBean readEntity(Cursor cursor, int offset) {
        MarkerLocalBean entity = new MarkerLocalBean( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // pipelineType
            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // pipelineDiameter
            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // pipelineMaterial
            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // buryMethod
            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // buryDepth
            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // area
            cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // line
            cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // road
            cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // constructTime
            cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // owner
            cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // objectId
            cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // markerId
            cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // markerType
            cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // markerDepth
            cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // installationDept
            cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // lng
            cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // lat
            cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18), // updateTime
            cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19), // remark
            cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20), // underlyingPipelineType
            cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21), // underlyingPipelineDepth
            cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22), // underlyingPipelineDiameter
            cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23), // underlyingPipelineMaterial
            cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // objectType
            cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25), // color
            cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26) // imagePath
        );
        return entity;
    }
     
    @Override
    public void readEntity(Cursor cursor, MarkerLocalBean entity, int offset) {
        entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
        entity.setPipelineType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
        entity.setPipelineDiameter(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
        entity.setPipelineMaterial(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
        entity.setBuryMethod(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
        entity.setBuryDepth(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
        entity.setArea(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
        entity.setLine(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
        entity.setRoad(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
        entity.setConstructTime(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
        entity.setOwner(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
        entity.setObjectId(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
        entity.setMarkerId(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
        entity.setMarkerType(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
        entity.setMarkerDepth(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
        entity.setInstallationDept(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
        entity.setLng(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16));
        entity.setLat(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
        entity.setUpdateTime(cursor.isNull(offset + 18) ? null : cursor.getString(offset + 18));
        entity.setRemark(cursor.isNull(offset + 19) ? null : cursor.getString(offset + 19));
        entity.setUnderlyingPipelineType(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
        entity.setUnderlyingPipelineDepth(cursor.isNull(offset + 21) ? null : cursor.getString(offset + 21));
        entity.setUnderlyingPipelineDiameter(cursor.isNull(offset + 22) ? null : cursor.getString(offset + 22));
        entity.setUnderlyingPipelineMaterial(cursor.isNull(offset + 23) ? null : cursor.getString(offset + 23));
        entity.setObjectType(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24));
        entity.setColor(cursor.isNull(offset + 25) ? null : cursor.getString(offset + 25));
        entity.setImagePath(cursor.isNull(offset + 26) ? null : cursor.getString(offset + 26));
     }
    
    @Override
    protected final Long updateKeyAfterInsert(MarkerLocalBean entity, long rowId) {
        entity.setId(rowId);
        return rowId;
    }
    
    @Override
    public Long getKey(MarkerLocalBean entity) {
        if(entity != null) {
            return entity.getId();
        } else {
            return null;
        }
    }

    @Override
    public boolean hasKey(MarkerLocalBean entity) {
        return entity.getId() != null;
    }

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