|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.j256.ormlite.dao.DaoManager
public class DaoManager
Class which caches created DAOs. Sometimes internal DAOs are used to support such features as auto-refreshing of foreign fields or collections of sub-objects. Since instantiation of the DAO is a bit expensive, this class is used in an attempt to only create a DAO once for each class.
NOTE: To use this cache, you should make sure you've added a DatabaseTable.daoClass()
value to the
annotation to the top of your class.
Constructor Summary | |
---|---|
DaoManager()
|
Method Summary | ||
---|---|---|
static void |
clearCache()
Clear out the cache. |
|
static
|
createDao(ConnectionSource connectionSource,
Class<T> clazz)
Helper method to create a Dao object without having to define a class. |
|
static
|
createDao(ConnectionSource connectionSource,
DatabaseTableConfig<T> tableConfig)
Helper method to create a Dao object without having to define a class. |
|
static void |
registerDao(ConnectionSource connectionSource,
Dao<?,?> dao)
Register the dao with the cache inside of this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DaoManager()
Method Detail |
---|
public static <D extends Dao<T,?>,T> D createDao(ConnectionSource connectionSource, Class<T> clazz) throws SQLException
BaseDaoImpl.createDao(ConnectionSource, Class)
.
SQLException
public static <D extends Dao<T,?>,T> D createDao(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig) throws SQLException
BaseDaoImpl.createDao(ConnectionSource, DatabaseTableConfig)
.
SQLException
public static void registerDao(ConnectionSource connectionSource, Dao<?,?> dao)
NOTE: It is better to use the DatabaseTable.daoClass()
and have the DaoManager construct the DAO
if possible.
public static void clearCache()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |