com.j256.ormlite.support
Class SimpleDaoSupport

java.lang.Object
  extended by com.j256.ormlite.support.SimpleDaoSupport
Direct Known Subclasses:
BaseJdbcDao

public abstract class SimpleDaoSupport
extends Object

Replacement for Spring's SimpleJdbcDaoSupport that provides some DAO methods. This could be rolled into the BaseJdbcDao (the only extender) but this mirrors the Spring hierarchy so should be left as is.

NOTE: If you are using the Spring type wiring in Java, initialize() should be called after all of the set methods. In Spring XML, init-method="initialize" should be used.

Author:
graywatson

Field Summary
protected  DatabaseAccess databaseAccess
           
protected  DatabaseType databaseType
           
 
Constructor Summary
protected SimpleDaoSupport()
          Constructor for Spring type wiring if you are using the set methods.
protected SimpleDaoSupport(DatabaseType databaseType)
           
protected SimpleDaoSupport(DatabaseType databaseType, DataSource dataSource)
          Constructor if you have the dataSource already.
 
Method Summary
 void initialize()
          If you are using the Spring type wiring, this should be called after all of the set methods.
 void setDatabaseType(DatabaseType databaseType)
          Used if you want to wire the Dao with spring.
 void setDataSource(DataSource dataSource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

databaseType

protected DatabaseType databaseType

databaseAccess

protected DatabaseAccess databaseAccess
Constructor Detail

SimpleDaoSupport

protected SimpleDaoSupport()
Constructor for Spring type wiring if you are using the set methods.


SimpleDaoSupport

protected SimpleDaoSupport(DatabaseType databaseType)

SimpleDaoSupport

protected SimpleDaoSupport(DatabaseType databaseType,
                           DataSource dataSource)
                    throws SQLException
Constructor if you have the dataSource already.

Throws:
SQLException
Method Detail

initialize

public void initialize()
                throws SQLException
If you are using the Spring type wiring, this should be called after all of the set methods. NOTE: this needs to throw because subclasses override it and might throw.

Throws:
SQLException

setDatabaseType

public void setDatabaseType(DatabaseType databaseType)
Used if you want to wire the Dao with spring. In java you should use the #BaseJdbcDao(DatabaseType, Class) constructor. This must be called before initialize().


setDataSource

public void setDataSource(DataSource dataSource)


Copyright © 2010. All Rights Reserved.