org.unitedfront2.dao.jdbc
クラス DaoSupport
java.lang.Object
org.unitedfront2.dao.jdbc.DaoSupport
- すべての実装されたインタフェース:
- InitializingBean, Dao, DateDao
- 直系の既知のサブクラス:
- DateDaoImpl, EmailForwardingDaoImpl, FootmarkDaoImpl, FriendDaoImpl, FriendSubscriptionDaoImpl, SelfIntroductionDaoImpl, SimpleDaoSupport, WidgetDaoImpl
abstract class DaoSupport
- extends Object
- implements InitializingBean, DateDao
DAO の実装において共通的に利用される機能を提供する抽象クラスです。特別な理由がない限り、DAO の実装
はこのクラスを継承してください。サブクラスは JdbcTemplate 、
NamedParameterJdbcTemplate 、SimpleJdbcTemplate 、
SimpleJdbcInsert を利用できます。これらは、アクセスがあった時点でプロパティに値が設定さ
れます(レイジーロード)。ただし、SimpleJdbcInsert だけは、サブクラスが
createSimpleJdbcInsert(DataSource) を正しく実装していなければ利用できません。
- 作成者:
- kurokkie
| クラス java.lang.Object から継承されたメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final Log logger
- ログ
DaoSupport
DaoSupport()
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- 定義:
- インタフェース
InitializingBean 内の afterPropertiesSet
- 例外:
Exception
getCurrentDate
public Date getCurrentDate()
- インタフェース
Dao の記述:
- 現在日時をデータベースから取得します。
- 定義:
- インタフェース
Dao 内の getCurrentDate
- 戻り値:
- 現在日時
createSimpleJdbcInsert
protected SimpleJdbcInsert createSimpleJdbcInsert(DataSource dataSource)
- この DAO で利用する
SimpleJdbcInsert を生成します。この実装は null を返してい
ます。SimpleJdbcInsert を利用する場合はサブクラスでこのメソッドをオーバーライドしてく
ださい。
- パラメータ:
dataSource - DataSource
- 戻り値:
SimpleJdbcInsert
setDataSource
public void setDataSource(DataSource dataSource)
getJdbcTemplate
protected JdbcTemplate getJdbcTemplate()
getNamedParameterJdbcTemplate
protected NamedParameterJdbcTemplate getNamedParameterJdbcTemplate()
getSimpleJdbcTemplate
protected SimpleJdbcTemplate getSimpleJdbcTemplate()
getSimpleJdbcInsert
protected SimpleJdbcInsert getSimpleJdbcInsert()
throws UnsupportedOperationException
SimpleJdbcInsert を取得します。サブクラスで
createSimpleJdbcInsert(DataSource) を正しくオーバーライドしていない場合、
このメソッド呼び出しは失敗し、UnsupportedOperationException が発生します。
- 戻り値:
SimpleJdbcInsert
- 例外:
UnsupportedOperationException - createSimpleJdbcInsert(DataSource) が正しく実装されていない可能性が
あります。
Copyright © 2007-2008 www.unitedfront2.org. All Rights Reserved.