package com.tofly.data.sql.dao;

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.tofly.ghrq_route.module.buildManage.domain.BuildManageFileBean;

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

    public static final String TABLENAME = "DB_BUILD_MANAGE_FILE";

    /**
     * Properties of entity BuildManageFileBean.<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 BuildId = new Property(1, String.class, "buildId", false, "BUILD_ID");
        public final static Property VoicePath = new Property(2, String.class, "voicePath", false, "VOICE_PATH");
        public final static Property VoiceName = new Property(3, String.class, "voiceName", false, "VOICE_NAME");
        public final static Property FilePath = new Property(4, String.class, "filePath", false, "FILE_PATH");
        public final static Property FileName = new Property(5, String.class, "fileName", false, "FILE_NAME");
        public final static Property ProcessId = new Property(6, String.class, "processId", false, "PROCESS_ID");
        public final static Property ExamineId = new Property(7, String.class, "examineId", false, "EXAMINE_ID");
        public final static Property ProcessFilePath = new Property(8, String.class, "processFilePath", false, "PROCESS_FILE_PATH");
        public final static Property ProcessFileName = new Property(9, String.class, "processFileName", false, "PROCESS_FILE_NAME");
        public final static Property ProcessVoiceName = new Property(10, String.class, "processVoiceName", false, "PROCESS_VOICE_NAME");
        public final static Property ProcessVoicePath = new Property(11, String.class, "processVoicePath", false, "PROCESS_VOICE_PATH");
        public final static Property AuditEndFilesName = new Property(12, String.class, "auditEndFilesName", false, "AUDIT_END_FILES_NAME");
        public final static Property AuditEndFilesPath = new Property(13, String.class, "auditEndFilesPath", false, "AUDIT_END_FILES_PATH");
        public final static Property Submit_state = new Property(14, String.class, "submit_state", false, "SUBMIT_STATE");
    }


    public BuildManageFileBeanDao(DaoConfig config) {
        super(config);
    }
    
    public BuildManageFileBeanDao(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 + "\"DB_BUILD_MANAGE_FILE\" (" + //
                "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
                "\"BUILD_ID\" TEXT," + // 1: buildId
                "\"VOICE_PATH\" TEXT," + // 2: voicePath
                "\"VOICE_NAME\" TEXT," + // 3: voiceName
                "\"FILE_PATH\" TEXT," + // 4: filePath
                "\"FILE_NAME\" TEXT," + // 5: fileName
                "\"PROCESS_ID\" TEXT," + // 6: processId
                "\"EXAMINE_ID\" TEXT," + // 7: examineId
                "\"PROCESS_FILE_PATH\" TEXT," + // 8: processFilePath
                "\"PROCESS_FILE_NAME\" TEXT," + // 9: processFileName
                "\"PROCESS_VOICE_NAME\" TEXT," + // 10: processVoiceName
                "\"PROCESS_VOICE_PATH\" TEXT," + // 11: processVoicePath
                "\"AUDIT_END_FILES_NAME\" TEXT," + // 12: auditEndFilesName
                "\"AUDIT_END_FILES_PATH\" TEXT," + // 13: auditEndFilesPath
                "\"SUBMIT_STATE\" TEXT);"); // 14: submit_state
    }

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

    @Override
    protected final void bindValues(DatabaseStatement stmt, BuildManageFileBean entity) {
        stmt.clearBindings();
 
        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }
 
        String buildId = entity.getBuildId();
        if (buildId != null) {
            stmt.bindString(2, buildId);
        }
 
        String voicePath = entity.getVoicePath();
        if (voicePath != null) {
            stmt.bindString(3, voicePath);
        }
 
        String voiceName = entity.getVoiceName();
        if (voiceName != null) {
            stmt.bindString(4, voiceName);
        }
 
        String filePath = entity.getFilePath();
        if (filePath != null) {
            stmt.bindString(5, filePath);
        }
 
        String fileName = entity.getFileName();
        if (fileName != null) {
            stmt.bindString(6, fileName);
        }
 
        String processId = entity.getProcessId();
        if (processId != null) {
            stmt.bindString(7, processId);
        }
 
        String examineId = entity.getExamineId();
        if (examineId != null) {
            stmt.bindString(8, examineId);
        }
 
        String processFilePath = entity.getProcessFilePath();
        if (processFilePath != null) {
            stmt.bindString(9, processFilePath);
        }
 
        String processFileName = entity.getProcessFileName();
        if (processFileName != null) {
            stmt.bindString(10, processFileName);
        }
 
        String processVoiceName = entity.getProcessVoiceName();
        if (processVoiceName != null) {
            stmt.bindString(11, processVoiceName);
        }
 
        String processVoicePath = entity.getProcessVoicePath();
        if (processVoicePath != null) {
            stmt.bindString(12, processVoicePath);
        }
 
        String auditEndFilesName = entity.getAuditEndFilesName();
        if (auditEndFilesName != null) {
            stmt.bindString(13, auditEndFilesName);
        }
 
        String auditEndFilesPath = entity.getAuditEndFilesPath();
        if (auditEndFilesPath != null) {
            stmt.bindString(14, auditEndFilesPath);
        }
 
        String submit_state = entity.getSubmit_state();
        if (submit_state != null) {
            stmt.bindString(15, submit_state);
        }
    }

    @Override
    protected final void bindValues(SQLiteStatement stmt, BuildManageFileBean entity) {
        stmt.clearBindings();
 
        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }
 
        String buildId = entity.getBuildId();
        if (buildId != null) {
            stmt.bindString(2, buildId);
        }
 
        String voicePath = entity.getVoicePath();
        if (voicePath != null) {
            stmt.bindString(3, voicePath);
        }
 
        String voiceName = entity.getVoiceName();
        if (voiceName != null) {
            stmt.bindString(4, voiceName);
        }
 
        String filePath = entity.getFilePath();
        if (filePath != null) {
            stmt.bindString(5, filePath);
        }
 
        String fileName = entity.getFileName();
        if (fileName != null) {
            stmt.bindString(6, fileName);
        }
 
        String processId = entity.getProcessId();
        if (processId != null) {
            stmt.bindString(7, processId);
        }
 
        String examineId = entity.getExamineId();
        if (examineId != null) {
            stmt.bindString(8, examineId);
        }
 
        String processFilePath = entity.getProcessFilePath();
        if (processFilePath != null) {
            stmt.bindString(9, processFilePath);
        }
 
        String processFileName = entity.getProcessFileName();
        if (processFileName != null) {
            stmt.bindString(10, processFileName);
        }
 
        String processVoiceName = entity.getProcessVoiceName();
        if (processVoiceName != null) {
            stmt.bindString(11, processVoiceName);
        }
 
        String processVoicePath = entity.getProcessVoicePath();
        if (processVoicePath != null) {
            stmt.bindString(12, processVoicePath);
        }
 
        String auditEndFilesName = entity.getAuditEndFilesName();
        if (auditEndFilesName != null) {
            stmt.bindString(13, auditEndFilesName);
        }
 
        String auditEndFilesPath = entity.getAuditEndFilesPath();
        if (auditEndFilesPath != null) {
            stmt.bindString(14, auditEndFilesPath);
        }
 
        String submit_state = entity.getSubmit_state();
        if (submit_state != null) {
            stmt.bindString(15, submit_state);
        }
    }

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

    @Override
    public BuildManageFileBean readEntity(Cursor cursor, int offset) {
        BuildManageFileBean entity = new BuildManageFileBean( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // buildId
            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // voicePath
            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // voiceName
            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // filePath
            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // fileName
            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // processId
            cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // examineId
            cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // processFilePath
            cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // processFileName
            cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // processVoiceName
            cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // processVoicePath
            cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // auditEndFilesName
            cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // auditEndFilesPath
            cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14) // submit_state
        );
        return entity;
    }
     
    @Override
    public void readEntity(Cursor cursor, BuildManageFileBean entity, int offset) {
        entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
        entity.setBuildId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
        entity.setVoicePath(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
        entity.setVoiceName(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
        entity.setFilePath(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
        entity.setFileName(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
        entity.setProcessId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
        entity.setExamineId(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
        entity.setProcessFilePath(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
        entity.setProcessFileName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
        entity.setProcessVoiceName(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
        entity.setProcessVoicePath(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
        entity.setAuditEndFilesName(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
        entity.setAuditEndFilesPath(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
        entity.setSubmit_state(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
     }
    
    @Override
    protected final Long updateKeyAfterInsert(BuildManageFileBean entity, long rowId) {
        entity.setId(rowId);
        return rowId;
    }
    
    @Override
    public Long getKey(BuildManageFileBean entity) {
        if(entity != null) {
            return entity.getId();
        } else {
            return null;
        }
    }

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

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