|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectorg.seasar.extension.jdbc.service.S2AbstractService<T>
T
- エンティティの型public abstract class S2AbstractService<T>
サービスを作るベースクラスです。
フィールドの概要 | |
---|---|
protected Class<T> |
entityClass
エンティティのクラスです。 |
protected JdbcManager |
jdbcManager
JDBCマネージャです。 |
protected String |
sqlFilePathPrefix
SQLファイルのパスのプレフィックスです。 |
コンストラクタの概要 | |
---|---|
S2AbstractService()
コンストラクタです。 |
|
S2AbstractService(Class<T> entityClass)
コンストラクタです。 |
メソッドの概要 | ||
---|---|---|
int |
delete(T entity)
エンティティを削除します。 |
|
List<T> |
findAll()
すべてのエンティティを検索します。 |
|
List<T> |
findByCondition(BeanMap conditions)
条件付で検索します。 |
|
long |
getCount()
件数を返します。 |
|
int |
insert(T entity)
エンティティを挿入します。 |
|
protected AutoSelect<T> |
select()
自動検索を返します。 |
|
protected
|
selectBySqlFile(Class<T2> baseClass,
String path)
SQLファイル検索を返します。 |
|
protected
|
selectBySqlFile(Class<T2> baseClass,
String path,
Object parameter)
SQLファイル検索を返します。 |
|
protected void |
setEntityClass(Class<T> entityClass)
エンティティのクラスを設定します。 |
|
int |
update(T entity)
エンティティを更新します。 |
|
protected SqlFileUpdate |
updateBySqlFile(String path)
SQLファイル更新を返します。 |
|
protected SqlFileUpdate |
updateBySqlFile(String path,
Object parameter)
SQLファイル更新を返します。 |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
---|
protected JdbcManager jdbcManager
protected Class<T> entityClass
protected String sqlFilePathPrefix
コンストラクタの詳細 |
---|
public S2AbstractService()
public S2AbstractService(Class<T> entityClass)
entityClass
- エンティティのクラスメソッドの詳細 |
---|
protected AutoSelect<T> select()
public List<T> findAll()
public List<T> findByCondition(BeanMap conditions)
conditions
- 条件
AutoSelect.where(Map)
public long getCount()
public int insert(T entity)
entity
- エンティティ
public int update(T entity)
entity
- エンティティ
public int delete(T entity)
entity
- エンティティ
protected <T2> SqlFileSelect<T2> selectBySqlFile(Class<T2> baseClass, String path)
T2
- 戻り値のJavaBeansの型baseClass
- 戻り値のJavaBeansのクラスpath
- エンティティのディレクトリ部分を含まないSQLファイルのパス
protected <T2> SqlFileSelect<T2> selectBySqlFile(Class<T2> baseClass, String path, Object parameter)
T2
- 戻り値のJavaBeansの型baseClass
- 戻り値のJavaBeansのクラスpath
- エンティティのディレクトリ部分を含まないSQLファイルのパスparameter
- パラメータ。
パラメータが1つしかない場合は、値を直接指定します。 パラメータが複数ある場合は、JavaBeansを作って、 プロパティ名をSQLファイルのバインド変数名とあわせます。 JavaBeansはpublicフィールドで定義することもできます。
パラメータが1つで型がDate
、Calendar
のいずれか場合、Parameter
に定義されたメソッドによりパラメータの時制を指定できます。
パラメータが1つで型がString
、byte[]
、Serializable
のいずれかの場合、Parameter
に定義されたメソッドによりパラメータをラージオブジェクトとして扱えます。
protected SqlFileUpdate updateBySqlFile(String path)
path
- エンティティのディレクトリ部分を含まないSQLファイルのパス
protected SqlFileUpdate updateBySqlFile(String path, Object parameter)
path
- エンティティのディレクトリ部分を含まないSQLファイルのパスparameter
- パラメータ用のJavaBeans
protected void setEntityClass(Class<T> entityClass)
entityClass
- エンティティのクラス
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |