public class SqlWhereTag extends CommonTagSupport
●形式:<og:where startKey="…" > <og:and startKey="…" ... /> </og:where> ●body:あり(EVAL_BODY_INCLUDE:BODYをインクルードし、{@XXXX} は解析しません) ●Tag定義: <og:where startKey 【TAG】SQL条件句の最初の演算子を指定します(初期値:where) debug 【TAG】デバッグ情報を出力するかどうか[true/false]を指定します(初期値:false) > ... Body ... </og:where> ●使用例 <og:query command="NEW"> select PN,YOBI,NMEN,HINM from XX01 where PN = '{@PN}' order by PN </og:query> ・検索条件が入力された時({@PN}がNOT NULLのとき) 作成されるSQL文⇒select PN,YOBI,NMEN,HINM from XX01 where PN = 'AAA' order by PN ・検索条件が入力されなかった時({@PN}がNULLのとき) 作成されるSQL文⇒select PN,YOBI,NMEN,HINM from XX01 where PN = '' order by PN <og:query command="NEW"> select PN,YOBI,NMEN,HINM from XX01 <og:where> <og:and value="PN = '{@PN}%'" /> <og:and value="YOBI like '{@YOBI}%'" /> </og:where> order by PN </og:query> ・検索条件が入力された時({@PN}がNOT NULLのとき) 作成されるSQL文⇒select PN,YOBI,NMEN,HINM from XX01 PN = 'AAA%' and YOBI like 'BBB%' order by PN ・検索条件が入力されなかった時({@PN}がNULLのとき) WHERE句がなくなる。 作成されるSQL文⇒select PN,YOBI,NMEN,HINM from XX01 order by PN 注意:WhereTagを使った場合、下のようにはなりません。 select PN,YOBI,NMEN,HINM from XX01 PN = '' and YOBI like '%' order by PN <og:query command="NEW"> select PN,YOBI,NMEN,HINM from XX01 where PN="11111" <og:where startKey="and"> <og:and value="YOBI like '{@PN}%'" /> </og:where> order by PN </og:query> ・検索条件が入力された時({@YOBI}がNOT NULLのとき) 作成されるSQL文⇒select PN,YOBI,NMEN,HINM from XX01 PN = '11111' and YOBI like 'BBB%' order by PN ・検索条件が入力されなかった時({@YOBI}がNULLのとき) WHERE句がなくなる。 作成されるSQL文⇒select PN,YOBI,NMEN,HINM from XX01 PN = '11111' order by PN
コンストラクタと説明 |
---|
SqlWhereTag() |
修飾子とタイプ | メソッドと説明 |
---|---|
int |
doEndTag()
Taglibの終了タグが見つかったときに処理する doEndTag() を オーバーライドします。
|
int |
doStartTag()
Taglibの開始タグが見つかったときに処理する doStartTag() を オーバーライドします。
|
protected java.lang.String |
getTagName()
タグの名称を、返します。
|
protected void |
release2()
タグリブオブジェクトをリリースします。
|
protected void |
setAttributes(Attributes attri)
内部タグの SqlAndTag / SqlAndTag より、個々のカラムの値を書き換える
為のアトリビュートを受け取る。
|
void |
setStartKey(java.lang.String skey)
【TAG】SQL条件句の最初の演算子を指定します(初期値:where)。
|
java.lang.String |
toString()
このオブジェクトの文字列表現を返します。
|
add, add, addEventColumn, addEventColumn, check, check, commitTableObject, debugPrint, doAfterBody, doCatch, doFinally, get, getApplicationInfo, getAttributes, getBodyRawString, getBodyString, getContextAttribute, getContextPath, getCookie, getCSVParameter, getDataCondition, getDateFormat, getDBColumn, getDBFunctionName, getDocumentLink, getGUIInfo, getGUIInfoAttri, getHostName, getLabel, getLabelInterface, getLanguage, getLASTAttri, getLongLabel, getMsglbl, getNVLAttri, getObject, getParameterNames, getParameterRows, getRequest, getRequestAttribute, getRequestCacheData, getRequestMethod, getRequestParameter, getRequestParameterValues, getRequestValue, getRequestValue, getRequestValues, getReservedParameter, getReservedValue, getResource, getSanitizedBodyString, getScope, getSessionAttribute, getUser, getUserEditInfo, getUserInfo, isAjaxSubmitRequest, isDebug, isNoTransitionRequest, isNull, jspPrint, removeContextAttribute, removeObject, removeRequestAttribute, removeSessionAttribute, set, setAjaxSubmitRequest, setCaseKey, setCaseNN, setCaseNull, setCaseVal, setContextAttribute, setCookie, setDebug, setLanguage, setLbl, setNoTransitionRequest, setObject, setObject, setParameterNames, setParameterRows, setRequestAttribute, setRequestCacheData, setScope, setSessionAttribute, setUserInfo, startQueryTransaction, sys, sysBool, sysInt, useMainTrans, useQuotCheck, useTag, useXssCheck
public SqlWhereTag()
public int doStartTag()
doStartTag
クラス内 CommonTagSupport
public int doEndTag()
doEndTag
クラス内 CommonTagSupport
3.1.1.2 (2003/04/04) Tomcat4.1 対応。release2() を doEndTag()で呼ぶ。 |
protected void release2()
release2
クラス内 CommonTagSupport
2.0.0.4 (2002/09/27) カスタムタグの release() メソッドを、追加 |
3.1.1.2 (2003/04/04) Tomcat4.1 対応。release2() を doEndTag()で呼ぶ。 |
protected void setAttributes(Attributes attri)
attri
- 属性リスト3.1.0.0 (2003/03/20) Vector を使用している箇所で、非同期でも構わない箇所を、ArrayList に置換え。 |
3.1.2.0 (2003/04/07) taglib パッケージ内部で使用している箇所を protected 化する。 |
public void setStartKey(java.lang.String skey)
skey
- 条件句の最初の演算子SQL条件句の最初の演算子を指定します。
protected java.lang.String getTagName()
getTagName
クラス内 CommonTagSupport
CommonTagSupport.getDocumentLink()
4.0.0.0 (2005/01/31) 新規追加 |
public java.lang.String toString()
toString
クラス内 CommonTagSupport
Webアプリケーションフレームワーク openGionCopyright (c) 2009 The openGion Project.