クラス OracleDialect
- java.lang.Object
-
- com.github.mygreen.sqlmapper.core.dialect.DialectBase
-
- com.github.mygreen.sqlmapper.core.dialect.OracleDialect
-
- すべての実装されたインタフェース:
Dialect
- 直系の既知のサブクラス:
OracleLegacyDialect
public class OracleDialect extends DialectBase
Oracle v12+用の方言の定義。- バージョン:
- 0.3
- 作成者:
- T.TSUCHIE
-
-
フィールドの概要
フィールド 修飾子とタイプ フィールド 説明 protected NumberableBooleanTypeobjectiveBooleanTypeDB側が整数型のとき、JavaのラッパーのBoolean型にマッピングします。protected NumberableBooleanTypeprimitiveBooleanTypeDB側が整数型のとき、Javaのboolean型にマッピングします。-
クラスから継承されたフィールド com.github.mygreen.sqlmapper.core.dialect.DialectBase
operationHandlerMap
-
-
コンストラクタの概要
コンストラクタ コンストラクタ 説明 OracleDialect()
-
メソッドの概要
すべてのメソッド インスタンス・メソッド concreteメソッド 修飾子とタイプ メソッド 説明 StringconvertLimitSql(String sql, int offset, int limit)LIMIT句用SQLに変換します。StringgetForUpdateSql(SelectForUpdateType type, int waitSeconds)SELECT文に付加するFOR UPDATE NOWAIT相当のSQLを返します。StringgetHintComment(String hint)ヒントコメントを返します。StringgetName()方言の名称を取得します。org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementergetSequenceIncrementer(DataSource dataSource, String sequenceName)シーケンスをインクリメントする処理を取得します。ValueType<?>getValueType(ValueType<?> valueType)対応するクラスタイプに対する値タイプを返します。booleanneedsParameterForResultSet()プロシージャの呼び出しでResultSetに対してパラメータが必要かどうかを判定します。booleansupportsGenerationType(GeneratedValue.GenerationType generationType)サポートする主キーの生成戦略を判定します。booleansupportsSelectForUpdate(SelectForUpdateType type)SELECT文でFOR UPDATEをサポートしていればtrueを返します。-
クラスから継承されたメソッド com.github.mygreen.sqlmapper.core.dialect.DialectBase
convertGetCountSql, getCountSql, getDefaultGenerationType, getOperationHandlerMap, register
-
-
-
-
フィールドの詳細
-
primitiveBooleanType
protected final NumberableBooleanType primitiveBooleanType
DB側が整数型のとき、Javaのboolean型にマッピングします。
-
objectiveBooleanType
protected final NumberableBooleanType objectiveBooleanType
DB側が整数型のとき、JavaのラッパーのBoolean型にマッピングします。
-
-
メソッドの詳細
-
getName
public String getName()
方言の名称を取得します。この値は、
SqlTemplateEngine.setSuffixName(String)にも使用されます。- 戻り値:
- "oracle"を返します。
-
supportsGenerationType
public boolean supportsGenerationType(GeneratedValue.GenerationType generationType)
サポートする主キーの生成戦略を判定します。- パラメータ:
generationType- 主キーの生成戦略。- 戻り値:
-
getSequenceIncrementer
public org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer getSequenceIncrementer(DataSource dataSource, String sequenceName)
シーケンスをインクリメントする処理を取得します。- パラメータ:
dataSource- データソースsequenceName- シーケンス名- 戻り値:
OracleSequenceMaxValueIncrementerのインスタンスを返す。
-
getValueType
public ValueType<?> getValueType(@Nullable ValueType<?> valueType)
対応するクラスタイプに対する値タイプを返します。 Oracleなどのようにbooleanが存在しない場合は対応するValueTypeに切り替えたりします。- 定義:
getValueTypeインタフェース内Dialect- オーバーライド:
getValueTypeクラス内DialectBase- パラメータ:
valueType- 値タイプ- 戻り値:
- 与えられた値が boolean/Booleanのとき、整数型に変換する
NumberableBooleanTypeに変換します。
-
getHintComment
public String getHintComment(String hint)
ヒントコメントを返します。ヒント句をサポートしていないDBの場合は空文字を返します。
- 定義:
getHintCommentインタフェース内Dialect- オーバーライド:
getHintCommentクラス内DialectBase- パラメータ:
hint- ヒント- 戻り値:
- コメントの形式 /*+ヒント*/ の形式で返します。
-
convertLimitSql
public String convertLimitSql(String sql, int offset, int limit)
LIMIT句用SQLに変換します。- 定義:
convertLimitSqlインタフェース内Dialect- オーバーライド:
convertLimitSqlクラス内DialectBase- パラメータ:
sql- SQLoffset- オフセット。省略する場合は -1を指定します。limit- リミット。省略する場合は -1 を指定します。- 戻り値:
- OFFSET/FETCH を使用して、LIMIT句を組み立てます。
- 例外:
IllegalArgumentException- 引数offset または limit の値の何れかが 0より小さい場合にスローされます。
-
supportsSelectForUpdate
public boolean supportsSelectForUpdate(SelectForUpdateType type)
SELECT文でFOR UPDATEをサポートしていればtrueを返します。- 定義:
supportsSelectForUpdateインタフェース内Dialect- オーバーライド:
supportsSelectForUpdateクラス内DialectBase- パラメータ:
type- SELECT ~ FOR UPDATEのタイプ- 戻り値:
- 必ずtrue を返します。
-
getForUpdateSql
public String getForUpdateSql(SelectForUpdateType type, int waitSeconds)
SELECT文に付加するFOR UPDATE NOWAIT相当のSQLを返します。- 定義:
getForUpdateSqlインタフェース内Dialect- オーバーライド:
getForUpdateSqlクラス内DialectBase- パラメータ:
type- SELECT ~ FOR UPDATEのタイプwaitSeconds-typeにSelectForUpdateType.WAITが指定された場合の待機時間(秒単位)- 戻り値:
SelectForUpdateType.NORMAL: for updateSelectForUpdateType.NOWAIT: for update nowaitSelectForUpdateType.WAIT: for update wait <waitSeconds>
-
needsParameterForResultSet
public boolean needsParameterForResultSet()
プロシージャの呼び出しでResultSetに対してパラメータが必要かどうかを判定します。- 定義:
needsParameterForResultSetインタフェース内Dialect- オーバーライド:
needsParameterForResultSetクラス内DialectBase- 戻り値:
- true を返します。
-
-