Back to project page blink.
The source code is released under:
Apache License
If you think the Android project blink listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.nashlincoln.blink.model; //from w w w . java 2 s .c o m import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; import de.greenrobot.dao.AbstractDaoMaster; import de.greenrobot.dao.identityscope.IdentityScopeType; import com.nashlincoln.blink.model.AttributeTypeDao; import com.nashlincoln.blink.model.AttributeDao; import com.nashlincoln.blink.model.DeviceTypeDao; import com.nashlincoln.blink.model.DeviceDao; import com.nashlincoln.blink.model.GroupDao; import com.nashlincoln.blink.model.GroupDeviceDao; import com.nashlincoln.blink.model.SceneDao; import com.nashlincoln.blink.model.SceneDeviceDao; import com.nashlincoln.blink.model.TimerDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * Master of DAO (schema version 1): knows all DAOs. */ public class DaoMaster extends AbstractDaoMaster { public static final int SCHEMA_VERSION = 1; /** Creates underlying database table using DAOs. */ public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) { AttributeTypeDao.createTable(db, ifNotExists); AttributeDao.createTable(db, ifNotExists); DeviceTypeDao.createTable(db, ifNotExists); DeviceDao.createTable(db, ifNotExists); GroupDao.createTable(db, ifNotExists); GroupDeviceDao.createTable(db, ifNotExists); SceneDao.createTable(db, ifNotExists); SceneDeviceDao.createTable(db, ifNotExists); TimerDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(SQLiteDatabase db, boolean ifExists) { AttributeTypeDao.dropTable(db, ifExists); AttributeDao.dropTable(db, ifExists); DeviceTypeDao.dropTable(db, ifExists); DeviceDao.dropTable(db, ifExists); GroupDao.dropTable(db, ifExists); GroupDeviceDao.dropTable(db, ifExists); SceneDao.dropTable(db, ifExists); SceneDeviceDao.dropTable(db, ifExists); TimerDao.dropTable(db, ifExists); } public static abstract class OpenHelper extends SQLiteOpenHelper { public OpenHelper(Context context, String name, CursorFactory factory) { super(context, name, factory, SCHEMA_VERSION); } @Override public void onCreate(SQLiteDatabase db) { Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION); createAllTables(db, false); } } /** WARNING: Drops all table on Upgrade! Use only during development. */ public static class DevOpenHelper extends OpenHelper { public DevOpenHelper(Context context, String name, CursorFactory factory) { super(context, name, factory); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables"); dropAllTables(db, true); onCreate(db); } } public DaoMaster(SQLiteDatabase db) { super(db, SCHEMA_VERSION); registerDaoClass(AttributeTypeDao.class); registerDaoClass(AttributeDao.class); registerDaoClass(DeviceTypeDao.class); registerDaoClass(DeviceDao.class); registerDaoClass(GroupDao.class); registerDaoClass(GroupDeviceDao.class); registerDaoClass(SceneDao.class); registerDaoClass(SceneDeviceDao.class); registerDaoClass(TimerDao.class); } public DaoSession newSession() { return new DaoSession(db, IdentityScopeType.Session, daoConfigMap); } public DaoSession newSession(IdentityScopeType type) { return new DaoSession(db, type, daoConfigMap); } }