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>
Constructor and Description |
---|
DaoFactory() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static <T,ID> com.j256.ormlite.dao.Dao<T,ID> createDao(com.j256.ormlite.support.ConnectionSource connectionSource, Class<T> clazz) throws SQLException
SQLException
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
SQLException
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.