org.seasar.extension.jdbc.query
クラス AutoSelectImpl<T>

java.lang.Object
  上位を拡張 org.seasar.extension.jdbc.query.AbstractQuery<S>
      上位を拡張 org.seasar.extension.jdbc.query.AbstractSelect<T,AutoSelect<T>>
          上位を拡張 org.seasar.extension.jdbc.query.AutoSelectImpl<T>
型パラメータ:
T - エンティティの型です。
すべての実装されたインタフェース:
AutoSelect<T>, Query<AutoSelect<T>>, Select<T,AutoSelect<T>>, SqlLogger

public class AutoSelectImpl<T>
extends AbstractSelect<T,AutoSelect<T>>
implements AutoSelect<T>

AutoSelectの実装クラスです。

作成者:
higa

フィールドの概要
protected  Map<String,? extends Object> conditions
          Mapによるwhere句の条件指定です。
protected  String criteria
          クライテリアです。
protected  Object[] criteriaParams
          クライテリア内のパラメータの配列です。
protected  String[] criteriaPropertyNames
          クライテリア内のパラメータに対応するプロパティ名の配列です。
protected  Set<String> eagerProperties
          EAGERフェッチするプロパティです。
protected  Map<String,AbstractEntityMapper> entityMapperMap
          エンティティマッパーのマップです。
protected  Map<String,EntityMeta> entityMetaMap
          エンティティメタデータのマップです。
protected  String entityName
          エンティティ名です。
protected  String forUpdate
          SELECT ~ FOR UPDATEのSQL文字列です。
protected  Map<String,String> forUpdateTargets
          SELECT ~ FOR UPDATEでロック対象となるエンティティからプロパティへのマップです。
protected  SelectForUpdateType forUpdateType
          SELECT ~ FOR UPDATEのタイプです。
protected  int forUpdateWaitSeconds
          SELECT ~ FOR UPDATEでの待機時間 (秒単位) です。
protected  FromClause fromClause
          from句です。
protected  String hint
          ヒントです。
protected  Object[] idProperties
          IDプロパティの値の配列です。
protected  List<PropertyMeta> idPropertyMetaList
          IDプロパティのメタデータのリストです。
protected  List<JoinMeta> joinMetaList
          結合メタデータのリストです。
protected  String orderBy
          ソート順です。
protected  OrderByClause orderByClause
          order by句です。
protected  SelectClause selectClause
          select句です。
protected  int selectListIndex
          selectリストのインデックスです。
protected  Map<String,String> tableAliasMap
          テーブル別名のマップです。
protected  int tableIndex
          テーブルのインデックスです。
protected  List<ValueType> valueTypeList
          値タイプのリストです。
protected  Object versionProperty
          バージョンプロパティの値です。
protected  PropertyMeta versionPropertyMeta
          バージョンプロパティのメタデータです。
protected  WhereClause whereClause
          where句です。
protected  List<Object> whereParams
          where句のパラメータです。
 
クラス org.seasar.extension.jdbc.query.AbstractSelect から継承されたフィールド
baseClass, count, disallowNoResult, fetchSize, limit, maxRows, offset, resultLob, resultTemporalType
 
クラス org.seasar.extension.jdbc.query.AbstractQuery から継承されたフィールド
callerClass, callerMethodName, executedSql, jdbcManager, logger, paramList, queryTimeout
 
コンストラクタの概要
AutoSelectImpl(JdbcManagerImplementor jdbcManager, Class<T> baseClass)
          AutoSelectImplを作成します。
 
メソッドの概要
protected  String convertCriteria(String str)
          プロパティ名で記述されたクライテリアをカラム名に変換します。
protected  String convertCriteria(String str, boolean convertAlias)
          プロパティ名で記述されたクライテリアをカラム名に変換します。
protected  String convertEntityNameToTableAlias(String str)
          文字列中のエンティティ名をテーブルの別名に変換します。
protected  ResultSetHandler createIterateResultSetHandler(IterationCallback<T,?> callback)
          反復する結果セットハンドラを作成します。
protected  AbstractRelationshipEntityMapper createRelationshipEntityMapper(Class<?> relationshipClass, PropertyMapper[] propertyMappers, int[] idIndices, PropertyMeta propertyMeta, PropertyMeta inversePropertyMeta)
          関連エンティティマッパーを作成します。
protected  ResultSetHandler createResultListResultSetHandler()
          リストを返す結果セットハンドラを作成します。
protected  ResultSetHandler createSingleResultResultSetHandler()
          単独の値を返す結果セットハンドラを作成します。
protected  String createTableAlias()
          テーブル別名を作成します。
 AutoSelect<T> eager(CharSequence... propertyNames)
          EAGERフェッチするプロパティを追加します。
 AutoSelect<T> forUpdate()
          FOR UPDATEを追加します。
 AutoSelect<T> forUpdate(CharSequence... propertyNames)
          FOR UPDATEを追加します。
 AutoSelect<T> forUpdateNowait()
          FOR UPDATE NOWAITを追加します。
 AutoSelect<T> forUpdateNowait(CharSequence... propertyNames)
          FOR UPDATE NOWAITを追加します。
 AutoSelect<T> forUpdateWait(int seconds)
          FOR UPDATE WAITを追加します。
 AutoSelect<T> forUpdateWait(int seconds, CharSequence... propertyNames)
          FOR UPDATE WAITを追加します。
protected  AbstractEntityMapper getBaseEntityMapper(String join, String baseJoin)
          ベースのエンティティメタマッパーを返します。
protected  EntityMeta getBaseEntityMeta(String join, String base)
          ベースのエンティティメタデータを返します。
protected  EntityMapper getEntityMapper()
          エンティティマッパーを返します。
protected  AbstractEntityMapper getEntityMapper(String join)
          エンティティマッパーを返します。
protected  EntityMeta getEntityMeta(String join)
          エンティティメタデータを返します。
protected  EntityMeta getInverseEntityMeta(Class<?> relationshipClass, String join)
          関連の逆側のエンティティメタデータを返します。
protected  PropertyMeta getInversePropertyMeta(EntityMeta inverseEntityMeta, PropertyMeta relationshipPropertyMeta)
          逆側のプロパティメタデータを返します。
protected  JoinMeta getJoinMeta(int index)
          結合メタデータを返します。
protected  int getJoinMetaSize()
          結合メタデータの数を返します。
protected  String getLockHint(String baseName)
          ロックヒントを返します。
protected  PropertyMeta getPropertyMeta(EntityMeta baseEntityMeta, String fullPropertyName, String propertyName)
          プロパティメタデータを返します。
protected  String getTableAlias(String join)
          テーブル別名を返します。
protected  ValueType[] getValueTypes()
          値タイプの配列を返します。
 AutoSelect<T> hint(String hint)
          ヒントを設定します。
 AutoSelect<T> id(Object... idProperties)
          where句の条件にIdプロパティ(主キー)を指定します。
 AutoSelect<T> innerJoin(CharSequence name)
          内部結合するプロパティを指定します。
 AutoSelect<T> innerJoin(CharSequence name, boolean fetch)
          内部結合するプロパティを指定します。
 AutoSelect<T> innerJoin(CharSequence name, boolean fetch, String condition, Object... params)
          内部結合するプロパティを指定します。
 AutoSelect<T> innerJoin(CharSequence name, boolean fetch, Where condition)
          内部結合するプロパティを指定します。
 AutoSelect<T> innerJoin(CharSequence name, String condition, Object... params)
          内部結合するプロパティを指定します。
 AutoSelect<T> innerJoin(CharSequence name, Where condition)
          内部結合するプロパティを指定します。
protected  boolean isLazy(PropertyMeta propertyMeta, JoinMeta joinMeta)
          プロパティのフェッチタイプがLAZYならtrueを返します。
 AutoSelect<T> join(CharSequence name, JoinType joinType)
          結合するプロパティを指定します。
 AutoSelect<T> join(CharSequence name, JoinType joinType, boolean fetch)
          結合するプロパティを指定します。
 AutoSelect<T> join(CharSequence name, JoinType joinType, boolean fetch, String condition, Object... params)
          結合するプロパティを指定します。
 AutoSelect<T> join(CharSequence name, JoinType joinType, boolean fetch, Where condition)
          結合するプロパティを指定します。
 AutoSelect<T> join(CharSequence name, JoinType joinType, String condition, Object... params)
          結合するプロパティを指定します。
 AutoSelect<T> join(CharSequence name, JoinType joinType, Where condition)
          結合するプロパティを指定します。
 AutoSelect<T> leftOuterJoin(CharSequence name)
          左外部結合するプロパティを指定します。
 AutoSelect<T> leftOuterJoin(CharSequence name, boolean fetch)
          左外部結合するプロパティを指定します。
 AutoSelect<T> leftOuterJoin(CharSequence name, boolean fetch, String condition, Object... params)
          左外部結合するプロパティを指定します。
 AutoSelect<T> leftOuterJoin(CharSequence name, boolean fetch, Where condition)
          左外部結合するプロパティを指定します。
 AutoSelect<T> leftOuterJoin(CharSequence name, String condition, Object... params)
          左外部結合するプロパティを指定します。
 AutoSelect<T> leftOuterJoin(CharSequence name, Where condition)
          左外部結合するプロパティを指定します。
 AutoSelect<T> orderBy(OrderByItem... orderByItems)
          ソート順を指定します。
 AutoSelect<T> orderBy(String orderBy)
          ソート順を指定します。
protected  void prepare(String methodName)
          クエリの準備をします。
protected  void prepareCondition(WhereClause whereTerm, String name, Object value)
          条件を準備します。
protected  void prepareConditions()
          where句の条件を準備します。
protected  void prepareCriteria()
          クライテリアの準備をします。
protected  void prepareEntity(EntityMeta em, JoinMeta joinMeta, String tableAlias, List<PropertyMapper> propertyMapperList, List<Integer> idIndexList)
          エンティティの準備をします。
protected  EntityMeta prepareEntityMeta(Class<?> entityClass, String join)
          エンティティメタデータを準備します。
protected  void prepareForUpdate()
          FOR UPDATE句を準備します。
protected  void prepareIdVersion()
          IDプロパティ及びバージョンを準備します。
protected  void prepareJoin(JoinMeta joinMeta)
          結合の準備をします。
protected  void prepareJoins()
          結合の準備をします。
protected  void prepareOrderBy()
          order by句の準備をします。
protected  void prepareParams()
          パラメータを準備します。
protected  void prepareParams(String name, Object value)
          パラメータを準備します。
protected  void prepareSql()
          SQLを準備します。
protected  String prepareTableAlias(String join)
          テーブル別名を準備します。
protected  void prepareTarget()
          対象エンティティの準備をします。
protected  void prepareWhere()
          where句のパラメータを準備します。
protected  void setupForUpdateTargets(String[] propertyNames)
          SELECT ~ FOR UPDATEの対象となるプロパティを準備します
protected  String[] splitBaseAndProperty(String name)
           関連名をベースとプロパティに分離します。
protected  Pair<String,String> toAliasPair(String baseName, String propertyName)
          SELECT ~ FOR UPDATEの対象となるテーブルエイリアスとカラムエイリアスのペアを返します。
protected  int[] toIdIndexArray(List<Integer> idIndexList)
          識別子のインデックスのリストをintの配列に変換します。
protected  PropertyMapperImpl[] toPropertyMapperArray(List<PropertyMapper> propertyMapperList)
          プロパティマッパーの配列に変換します。
protected  String toSql()
          SQLに変換します。
 AutoSelect<T> version(Object versionProperty)
          where句の条件にバージョンプロパティを指定します。
 AutoSelect<T> where(Map<String,? extends Object> conditions)
          where句の条件を指定します。
 AutoSelect<T> where(String criteria, Object... params)
          where句の条件を指定します。
 AutoSelect<T> where(Where... wheres)
          where句の条件を指定します。
 AutoSelect<T> where(Where where)
          where句の条件を指定します。
 
クラス org.seasar.extension.jdbc.query.AbstractSelect から継承されたメソッド
convertLimitSql, disallowNoResult, fetchSize, getBaseClass, getCount, getFetchSize, getLimit, getMaxRows, getOffset, getResultList, getResultListInternal, getSingleResult, getSingleResultInternal, iterate, iterateInternal, limit, lob, maxRows, offset, processCursorPreparedStatement, processPreparedStatement, processResultSet, setupPreparedStatement, temporal
 
クラス org.seasar.extension.jdbc.query.AbstractQuery から継承されたメソッド
addParam, addParam, addParam, addParam, callerClass, callerMethodName, getCallerClass, getCallerMethodName, getExecutedSql, getJdbcManager, getParam, getParamClasses, getParamSize, getParamValues, getParamValueTypes, getQueryTimeout, getValueType, handleResultSet, logSql, logSql, prepareCallerClassAndMethodName, prepareInParams, queryTimeout, resetParams, toStringArray
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース org.seasar.extension.jdbc.AutoSelect から継承されたメソッド
getCount
 
インタフェース org.seasar.extension.jdbc.Select から継承されたメソッド
disallowNoResult, fetchSize, getResultList, getSingleResult, iterate, limit, lob, maxRows, offset, temporal
 
インタフェース org.seasar.extension.jdbc.Query から継承されたメソッド
callerClass, callerMethodName, queryTimeout
 

フィールドの詳細

joinMetaList

protected List<JoinMeta> joinMetaList
結合メタデータのリストです。


tableIndex

protected int tableIndex
テーブルのインデックスです。


tableAliasMap

protected Map<String,String> tableAliasMap
テーブル別名のマップです。


entityMetaMap

protected Map<String,EntityMeta> entityMetaMap
エンティティメタデータのマップです。


entityName

protected String entityName
エンティティ名です。


selectClause

protected SelectClause selectClause
select句です。


fromClause

protected FromClause fromClause
from句です。


whereClause

protected WhereClause whereClause
where句です。


orderByClause

protected OrderByClause orderByClause
order by句です。


orderBy

protected String orderBy
ソート順です。


forUpdate

protected String forUpdate
SELECT ~ FOR UPDATEのSQL文字列です。


forUpdateType

protected SelectForUpdateType forUpdateType
SELECT ~ FOR UPDATEのタイプです。


forUpdateTargets

protected Map<String,String> forUpdateTargets
SELECT ~ FOR UPDATEでロック対象となるエンティティからプロパティへのマップです。


forUpdateWaitSeconds

protected int forUpdateWaitSeconds
SELECT ~ FOR UPDATEでの待機時間 (秒単位) です。


eagerProperties

protected Set<String> eagerProperties
EAGERフェッチするプロパティです。


hint

protected String hint
ヒントです。


valueTypeList

protected List<ValueType> valueTypeList
値タイプのリストです。


selectListIndex

protected int selectListIndex
selectリストのインデックスです。


entityMapperMap

protected Map<String,AbstractEntityMapper> entityMapperMap
エンティティマッパーのマップです。


whereParams

protected List<Object> whereParams
where句のパラメータです。


conditions

protected Map<String,? extends Object> conditions
Mapによるwhere句の条件指定です。


criteria

protected String criteria
クライテリアです。


criteriaParams

protected Object[] criteriaParams
クライテリア内のパラメータの配列です。


criteriaPropertyNames

protected String[] criteriaPropertyNames
クライテリア内のパラメータに対応するプロパティ名の配列です。


idPropertyMetaList

protected List<PropertyMeta> idPropertyMetaList
IDプロパティのメタデータのリストです。


idProperties

protected Object[] idProperties
IDプロパティの値の配列です。


versionPropertyMeta

protected PropertyMeta versionPropertyMeta
バージョンプロパティのメタデータです。


versionProperty

protected Object versionProperty
バージョンプロパティの値です。

コンストラクタの詳細

AutoSelectImpl

public AutoSelectImpl(JdbcManagerImplementor jdbcManager,
                      Class<T> baseClass)
AutoSelectImplを作成します。

パラメータ:
jdbcManager - 内部的なJDBCマネージャ
baseClass - ベースクラス
メソッドの詳細

innerJoin

public AutoSelect<T> innerJoin(CharSequence name)
インタフェース AutoSelect の記述:
内部結合するプロパティを指定します。

指定したエンティティはフェッチされます。

定義:
インタフェース AutoSelect<T> 内の innerJoin
パラメータ:
name - 内部結合する関連のプロパティ名
戻り値:
このインスタンス自身
関連項目:
JoinMeta, #Join(CharSequence, JoinType)

innerJoin

public AutoSelect<T> innerJoin(CharSequence name,
                               String condition,
                               Object... params)
インタフェース AutoSelect の記述:
内部結合するプロパティを指定します。

指定したエンティティはフェッチされます。

定義:
インタフェース AutoSelect<T> 内の innerJoin
パラメータ:
name - 内部結合する関連のプロパティ名
condition - 付加的な結合条件
params - 付加的な結合条件のパラメータの配列

パラメータの配列の要素がDateCalendarのいずれか場合、 Parameterに定義されたメソッドによりパラメータの時制を指定できます。

パラメータの配列の要素がStringbyte[]Serializableのいずれかの場合、Parameter に定義されたメソッドによりパラメータをラージオブジェクトとして扱えます。

戻り値:
このインスタンス自身
関連項目:
JoinMeta, #Join(CharSequence, JoinType)

innerJoin

public AutoSelect<T> innerJoin(CharSequence name,
                               Where condition)
インタフェース AutoSelect の記述:
内部結合するプロパティを指定します。

指定したエンティティはフェッチされます。

定義:
インタフェース AutoSelect<