com.hamaf.hikyaku.dataobject.utils
クラス Dto2SqlUtils

java.lang.Object
  上位を拡張 com.hamaf.hikyaku.dataobject.utils.Dto2SqlUtils

public class Dto2SqlUtils
extends java.lang.Object

タイトル:DtoUtils is create SQL by DataObject.

説明:データオブジェクトよりSQL文を生成するユーティリティ集


以下の操作をstaticで提供する。
RetrieveKeysInterface,DetailItemsInterfaceに共通な機能
  1. getWhereString() : 条件文(where以降)を生成する
  2. getSelectString() : Select句を生成する

DetailItemsInterfaceのみに提供する機能
  1. getSelectStringWithExclusion : 共通項目付きでSelect句を生成する
  2. getInsertItem : insert句を生成する
  3. getInsertItemWithExclusion : 共通項目付きでinsert句を生成する
  4. getInsertValue : insert用のvalues句を生成する
  5. getInsertValueWithExclusion : 共通項目付きでinsert用のvalues句を生成する
  6. getUpdateString : update句を生成する
  7. getUpdateStringWithExclusion : 共通項目付きでupdate句を生成する

著作権: Copyright (c) 2007/05/31

バージョン:
1.0
作成者:
y-hamanaka

コンストラクタの概要
Dto2SqlUtils()
           
 
メソッドの概要
static java.lang.String getInsertItem(DetailItemsInterface dii)
          Method getInsertItem is return insert item string.
static java.lang.String getInsertItemWithExclusion(DetailItemsInterface dii)
          Method getInsertItemWithExclusion is return insert item string added Exclusion.
static java.lang.String getInsertValue(DetailItemsInterface dii)
          Method getInsertValue is return insert value string.
static java.lang.String getInsertValueWithExclusion(DetailItemsInterface dii)
          Method getInsertValue is return insert value string added Exclusion.
static java.lang.String getSelectItems(DetailItemsInterface dii)
          Method getSelectItems is return get item string.
static java.lang.String getSelectItems(RetrieveKeysInterface rki, java.util.List<java.lang.String> pkeys)
          Method getSelectItems is return SQL String Select.
static java.lang.String getSelectItemsWithExclusion(DetailItemsInterface dii)
          Method getSelectItemsWithExclusion is return Select string added Exclusion items.
static java.lang.String getUpdateItems(DetailItemsInterface dii)
          Method getUpdateItems is return update item string.
static java.lang.String getUpdateItemsWithExclusion(DetailItemsInterface dii)
          Method getUpdateItemsWithExclusion is return update item string added Exclusion.
static java.lang.String getWhereString(DetailItemsInterface dii, java.util.List<java.lang.String> keys)
          Method getWhereString is return SQL Where String.
static java.lang.String getWhereString(RetrieveKeysInterface rki)
          Method getWhereString is return SQL String Where and Order By.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

Dto2SqlUtils

public Dto2SqlUtils()
メソッドの詳細

getWhereString

public static final java.lang.String getWhereString(RetrieveKeysInterface rki)
Method getWhereString is return SQL String Where and Order By.
検索、並び順のSQLステートメントを戻す。
検索条件式により、検索値の編集を行う。
作成されるSQL文は"WHERE .... ORDER BY ...."

パラメータ:
rki - RetrieveKeysInterface
戻り値:
String : 検索、並び順用のSQL文字列

getSelectItems

public static java.lang.String getSelectItems(RetrieveKeysInterface rki,
                                              java.util.List<java.lang.String> pkeys)
Method getSelectItems is return SQL String Select.
キー項目を設定したSELECT句用項目名称SQLステートメントを戻す。
RetrieveKeysInterfaceで未定義の場合は、キー項目名のリストから生成する。

パラメータ:
rki - RetrieveKeysInterface
pkeys - List : キー項目名のリスト
戻り値:
String : SELECT句用のSQL文字列

getWhereString

public static final java.lang.String getWhereString(DetailItemsInterface dii,
                                                    java.util.List<java.lang.String> keys)
Method getWhereString is return SQL Where String.
プライマリキーで検索するWhere句SQL文字列を戻す。
DetailItemsInterfaceで定義されていない場合は、キー項目名のリストから生成する。

パラメータ:
dii - a DetailItemsInterface :
keys - a List : PrimaryKey項目名のリスト
戻り値:
String

getSelectItems

public static final java.lang.String getSelectItems(DetailItemsInterface dii)
Method getSelectItems is return get item string.
取得する項目名を","で連結したSelect句用項目名SQL文字列を戻す。
作成されるSQL文は"項目名, ...."

戻り値:
String

getSelectItemsWithExclusion

public static final java.lang.String getSelectItemsWithExclusion(DetailItemsInterface dii)
Method getSelectItemsWithExclusion is return Select string added Exclusion items.
規定の排他制御用の項目("UPD_DATE,UPD_TIME")を追加し、
取得する項目名を","で連結したSelect句用項目名SQL文字列を戻す。
作成されるSQL文は"SELECT 項目名, ...., UPD_DATE, UPD_TIME"

戻り値:
String

getInsertItem

public static final java.lang.String getInsertItem(DetailItemsInterface dii)
Method getInsertItem is return insert item string.
登録用の項目名を","で連結した文字列を戻す。

戻り値:
String

getInsertItemWithExclusion

public static final java.lang.String getInsertItemWithExclusion(DetailItemsInterface dii)
Method getInsertItemWithExclusion is return insert item string added Exclusion.
排他制御用の規定の項目名と登録用の項目名を","で連結した文字列を戻す。

戻り値:
String

getInsertValue

public static final java.lang.String getInsertValue(DetailItemsInterface dii)
Method getInsertValue is return insert value string.
登録用の項目の値を","で連結した文字列を戻す。

戻り値:
String

getInsertValueWithExclusion

public static final java.lang.String getInsertValueWithExclusion(DetailItemsInterface dii)
Method getInsertValue is return insert value string added Exclusion.
排他制御用の項目と登録用の項目の値を","で連結した文字列を戻す。

戻り値:
String

getUpdateItems

public static final java.lang.String getUpdateItems(DetailItemsInterface dii)
Method getUpdateItems is return update item string.
更新用のSET句用の文字列を戻す。
作成されるSQL文は"項目名='値', ...."

戻り値:
String

getUpdateItemsWithExclusion

public static final java.lang.String getUpdateItemsWithExclusion(DetailItemsInterface dii)
Method getUpdateItemsWithExclusion is return update item string added Exclusion.
規定の排他制御用の項目を設定した更新用のSET句用の文字列を戻す。
作成されるSQL文は"項目名='値', ...., UPD_DATE='yyyy/mm/dd', UPD_TIME='hh:mm:ss'"

戻り値:
String