com.j256.ormlite.spring
Class DaoFactory
java.lang.Object
com.j256.ormlite.spring.DaoFactory
public class DaoFactory
- extends Object
Spring bean that can be used to create Dao's of certain classes without needing their own Dao class.
Here is an example of spring wiring. See the Spring example in the documentation for more info.
<bean id="accountDao" class="com.j256.ormlite.spring.DaoFactory" factory-method="createDao">
<constructor-arg index="0" ref="connectionSource" />
<constructor-arg index="1" value="com.j256.ormlite.examples.spring.Account" />
</bean>
- Author:
- graywatson
Method Summary |
static
<T,ID> com.j256.ormlite.dao.Dao<T,ID> |
|
createDao(com.j256.ormlite.support.ConnectionSource connectionSource,
Class<T> clazz)
Create and return a Dao based on the arguments. |
static
<T,ID> com.j256.ormlite.dao.Dao<T,ID> |
|
createDao(com.j256.ormlite.support.ConnectionSource connectionSource,
com.j256.ormlite.table.DatabaseTableConfig<T> tableConfig)
Create and return a Dao based on the arguments. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DaoFactory
public DaoFactory()
createDao
public static <T,ID> com.j256.ormlite.dao.Dao<T,ID> createDao(com.j256.ormlite.support.ConnectionSource connectionSource,
Class<T> clazz)
throws SQLException
- Create and return a Dao based on the arguments.
- Throws:
SQLException
createDao
public static <T,ID> com.j256.ormlite.dao.Dao<T,ID> createDao(com.j256.ormlite.support.ConnectionSource connectionSource,
com.j256.ormlite.table.DatabaseTableConfig<T> tableConfig)
throws SQLException
- Create and return a Dao based on the arguments.
- Throws:
SQLException
This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.