package model.daoModels;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.Property;
import de.greenrobot.dao.internal.DaoConfig;
import model.daoModels.LanguageLocale;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "LANGUAGE_LOCALE".
*/
public class LanguageLocaleDao extends AbstractDao<LanguageLocale, Long> {
public static final String TABLENAME = "LANGUAGE_LOCALE";
/**
* Properties of entity LanguageLocale.<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 LanguageDirection = new Property(1, String.class, "languageDirection", false, "LANGUAGE_DIRECTION");
public final static Property LanguageKey = new Property(2, String.class, "languageKey", false, "LANGUAGE_KEY");
public final static Property LanguageName = new Property(3, String.class, "languageName", false, "LANGUAGE_NAME");
public final static Property Cc = new Property(4, String.class, "cc", false, "CC");
public final static Property LanguageRegion = new Property(5, String.class, "LanguageRegion", false, "LANGUAGE_REGION");
public final static Property Pk = new Property(6, Integer.class, "pk", false, "PK");
public final static Property Gw = new Property(7, Boolean.class, "gw", false, "GW");
};
public LanguageLocaleDao(DaoConfig config) {
super(config);
}
public LanguageLocaleDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"LANGUAGE_LOCALE\" (" + //
"\"_id\" INTEGER PRIMARY KEY ," + // 0: id
"\"LANGUAGE_DIRECTION\" TEXT," + // 1: languageDirection
"\"LANGUAGE_KEY\" TEXT," + // 2: languageKey
"\"LANGUAGE_NAME\" TEXT," + // 3: languageName
"\"CC\" TEXT," + // 4: cc
"\"LANGUAGE_REGION\" TEXT," + // 5: LanguageRegion
"\"PK\" INTEGER," + // 6: pk
"\"GW\" INTEGER);"); // 7: gw
}
/** Drops the underlying database table. */
public static void dropTable(SQLiteDatabase db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LANGUAGE_LOCALE\"";
db.execSQL(sql);
}
/** @inheritdoc */
@Override
protected void bindValues(SQLiteStatement stmt, LanguageLocale entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String languageDirection = entity.getLanguageDirection();
if (languageDirection != null) {
stmt.bindString(2, languageDirection);
}
String languageKey = entity.getLanguageKey();
if (languageKey != null) {
stmt.bindString(3, languageKey);
}
String languageName = entity.getLanguageName();
if (languageName != null) {
stmt.bindString(4, languageName);
}
String cc = entity.getCc();
if (cc != null) {
stmt.bindString(5, cc);
}
String LanguageRegion = entity.getLanguageRegion();
if (LanguageRegion != null) {
stmt.bindString(6, LanguageRegion);
}
Integer pk = entity.getPk();
if (pk != null) {
stmt.bindLong(7, pk);
}
Boolean gw = entity.getGw();
if (gw != null) {
stmt.bindLong(8, gw ? 1L: 0L);
}
}
/** @inheritdoc */
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
/** @inheritdoc */
@Override
public LanguageLocale readEntity(Cursor cursor, int offset) {
LanguageLocale entity = new LanguageLocale( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // languageDirection
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // languageKey
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // languageName
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // cc
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // LanguageRegion
cursor.isNull(offset + 6) ? null : cursor.getInt(offset + 6), // pk
cursor.isNull(offset + 7) ? null : cursor.getShort(offset + 7) != 0 // gw
);
return entity;
}
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, LanguageLocale entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setLanguageDirection(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setLanguageKey(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setLanguageName(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setCc(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setLanguageRegion(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setPk(cursor.isNull(offset + 6) ? null : cursor.getInt(offset + 6));
entity.setGw(cursor.isNull(offset + 7) ? null : cursor.getShort(offset + 7) != 0);
}
/** @inheritdoc */
@Override
protected Long updateKeyAfterInsert(LanguageLocale entity, long rowId) {
entity.setId(rowId);
return rowId;
}
/** @inheritdoc */
@Override
public Long getKey(LanguageLocale entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
/** @inheritdoc */
@Override
protected boolean isEntityUpdateable() {
return true;
}
}