|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.database.sqlite.SQLiteOpenHelper
com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper
public abstract class OrmLiteSqliteOpenHelper
SQLite database open helper which can be extended by your application to help manage when the application needs to create or upgrade its database.
Constructor Summary | |
---|---|
OrmLiteSqliteOpenHelper(android.content.Context context,
String databaseName,
android.database.sqlite.SQLiteDatabase.CursorFactory factory,
int databaseVersion)
|
Method Summary | ||
---|---|---|
void |
close()
Close any open connections. |
|
com.j256.ormlite.support.ConnectionSource |
getConnectionSource()
Get the connection source associated with the helper. |
|
|
getDao(Class<T> clazz)
Get a DAO for our class. |
|
boolean |
isOpen()
Return true if the helper is still open. |
|
void |
onCreate(android.database.sqlite.SQLiteDatabase db)
Satisfies the SQLiteOpenHelper.onCreate(SQLiteDatabase) interface method. |
|
abstract void |
onCreate(android.database.sqlite.SQLiteDatabase database,
com.j256.ormlite.support.ConnectionSource connectionSource)
What to do when your database needs to be created. |
|
abstract void |
onUpgrade(android.database.sqlite.SQLiteDatabase database,
com.j256.ormlite.support.ConnectionSource connectionSource,
int oldVersion,
int newVersion)
What to do when your database needs to be updated. |
|
void |
onUpgrade(android.database.sqlite.SQLiteDatabase db,
int oldVersion,
int newVersion)
Satisfies the SQLiteOpenHelper.onUpgrade(SQLiteDatabase, int, int) interface method. |
Methods inherited from class android.database.sqlite.SQLiteOpenHelper |
---|
getReadableDatabase, getWritableDatabase, onOpen |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OrmLiteSqliteOpenHelper(android.content.Context context, String databaseName, android.database.sqlite.SQLiteDatabase.CursorFactory factory, int databaseVersion)
Method Detail |
---|
public abstract void onCreate(android.database.sqlite.SQLiteDatabase database, com.j256.ormlite.support.ConnectionSource connectionSource)
NOTE: You should use the connectionSource argument that is passed into this method call or the one returned by getConnectionSource(). If you use your own, a recursive call or other unexpected results may result.
database
- Database being created.connectionSource
- To use get connections to the database to be created.public abstract void onUpgrade(android.database.sqlite.SQLiteDatabase database, com.j256.ormlite.support.ConnectionSource connectionSource, int oldVersion, int newVersion)
NOTE: You should use the connectionSource argument that is passed into this method call or the one returned by getConnectionSource(). If you use your own, a recursive call or other unexpected results may result.
database
- Database being upgraded.connectionSource
- To use get connections to the database to be updated.oldVersion
- The version of the current database so we can know what to do to the database.newVersion
- The version that we are upgrading the database to.public com.j256.ormlite.support.ConnectionSource getConnectionSource()
public final void onCreate(android.database.sqlite.SQLiteDatabase db)
SQLiteOpenHelper.onCreate(SQLiteDatabase)
interface method.
onCreate
in class android.database.sqlite.SQLiteOpenHelper
public final void onUpgrade(android.database.sqlite.SQLiteDatabase db, int oldVersion, int newVersion)
SQLiteOpenHelper.onUpgrade(SQLiteDatabase, int, int)
interface method.
onUpgrade
in class android.database.sqlite.SQLiteOpenHelper
public void close()
close
in class android.database.sqlite.SQLiteOpenHelper
public boolean isOpen()
close()
is called then this will return false.
public <D extends com.j256.ormlite.dao.Dao<T,?>,T> D getDao(Class<T> clazz) throws SQLException
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |