クラス RdbAdapter
java.lang.Object
org.iplass.mtp.impl.rdb.adapter.RdbAdapter
- 直系の既知のサブクラス:
MysqlRdbAdaptor,NoopRdbAdapter,OracleRdbAdapter,PostgreSQLRdbAdapter,SqlServerRdbAdapter
-
コンストラクタの概要
コンストラクタ -
メソッドの概要
修飾子とタイプメソッド説明protected <T extends Aggregate>
voidaddAggregateFunction(Class<T> aggType, AggregateFunctionAdapter<T> functionAdapter) abstract Stringprotected voidaddFunction(FunctionAdapter<Function> functionAdapter) abstract voidappendSortSpecExpression(StringBuilder sb, CharSequence sortValue, SortSpec.SortType sortType, SortSpec.NullOrderingSpec nullOrderingSpec) cast(int fromSqlType, int toSqlType, CharSequence valExpr, Integer lengthOrPrecision, Integer scale) String[]abstract Stringabstract String[]timezoneを変更したtimestampを取得する関数。countQuery(Query q) abstract StringcreateBinaryViewColumnSql(int colNo, String colName, String lobIdSuffix) Binary型のビューカラムのSQLを作成します。abstract BulkDeleteContextabstract BulkInsertContextabstract BulkUpdateContextabstract StringcreateLocalTemporaryTable(String tableName, String baseTableName, String[] baseColumnName) ローカルなTemporaryTableを作成する。abstract StringcreateLongTextViewColumnSql(int colNo, String colName, String lobIdSuffix) LongText型のビューカラムのSQLを作成します。abstract MultiInsertContextcreateRowLockSql(String sql) 行ロックのSQLを作成します。abstract StringcreateViewColumnSql(int colNo, String colName) ビューカラムのSQLを作成します。abstract StringdeleteTemporaryTable(String tableName) TemporaryTableを削除(global temporary tableの場合はデータを削除する)するSQLを生成。abstract Stringdual()abstract Stringescape()Likeのエスケープ文字指定構文。abstract intバッチ更新利用する際の推奨バッチサイズ。final ConnectiongetConnection(String connectionFactoryName) protected abstract StringgetDataTypeOf(int sqlType, Integer lengthOrPrecision, Integer scale) abstract intLIMIT句のための省略時のOrderBy句を取得します。abstract intabstract intabstract intintビュー名の最大長を取得します。Multi-Table Trickで利用する句。abstract MultiTableUpdateMethodabstract Stringabstract String[]abstract HintPlace<T extends QuerySqlHandler>
TgetQuerySqlCreator(Class<T> sqlCreatorClass) getRdbTypeAdapter(Object value) getRdbTypeAdapter(PropertyType propType) abstract String[]abstract ResultSetgetTableNames(String tableNamePattern, Connection con) abstract int複数の更新(追加)を一括で処理する際の、PrepareStatementを利用するか否かを判断するための閾値。<T extends UpdateSqlHandler>
TgetUpdateSqlCreator(Class<T> sqlCreatorClass) ビューのサブクエリエイリアスを取得します。abstract StringinitBlob()abstract booleanEQLをSQLに変換する際、常にバインド変数化するか否か。abstract booleanabstract booleanabstract booleanabstract booleanbindヒント句を有効化するか否かabstract booleanabstract booleanbooleanUPDATE文の表名にエイリアスを使用する場合はFROM句が必要かを判別します。booleanMulti-Table Trickを利用するか否かを指定。abstract booleanbooleanBLOB型をサポートしているかを判別します。abstract booleanglobal temporary tableをサポートしている場合はtrueabstract booleanabstract booleanisSupportGroupingExtention(GroupBy.RollType rollType) abstract booleanabstract booleanboolean行値構成子(行値式)をサポートしているかを判別します。abstract booleanabstract booleanabstract booleanabstract StringlikePattern(String str) EQLのLikeのパターン文字列で、 %、_、\を\でエスケープされているEQLでの文字列を、RDBネイティブなエスケープ構文に変換する。final <T extends Aggregate>
AggregateFunctionAdapter<T> resolveAggregateFunction(Class<T> aggClass) final FunctionAdapter<Function> resolveFunction(String name) abstract StringrollUpEnd(GroupBy.RollType rollType) abstract StringrollUpStart(GroupBy.RollType rollType) abstract Stringfinal StringsanitizeForLike(String str) SQLのlike文のパターン文字列に設定するエスケープ処理。abstract StringseqNextSelectSql(String sequenceName, int tenantId, String entityDefId) voidsetListaggDefaultSeparator(String listaggDefaultSeparator) voidsetParameter(PreparedStatement ps, int index, Object rdbValue) voidsetRdbTimeZone(String rdbTimeZone) abstract Stringabstract StringtableAlias(String selectSql) abstract StringtoCreateViewDDL(String viewName, String selectSql, boolean withDropView) 指定のSELECT文をビュー作成DDLにします。abstract StringtoDateExpression(Date date) toLimitSql(String selectSql, int limitCount, int offset) abstract StringtoLimitSql(String selectSql, int limitCount, int offset, boolean asBind) abstract Object[]toLimitSqlBindValue(int limitCount, int offset) abstract StringtoTimeExpression(Time time) abstract StringwindowRankFunctionName(WindowRankFunction rankFunc)
-
コンストラクタの詳細
-
RdbAdapter
public RdbAdapter()
-
-
メソッドの詳細
-
addAggregateFunction
protected <T extends Aggregate> void addAggregateFunction(Class<T> aggType, AggregateFunctionAdapter<T> functionAdapter) -
addFunction
-
getUpdateSqlCreator
-
getQuerySqlCreator
-
castExp
-
cast
public CharSequence cast(int fromSqlType, int toSqlType, CharSequence valExpr, Integer lengthOrPrecision, Integer scale) -
countQuery
-
isSupportOptimizerHint
public abstract boolean isSupportOptimizerHint() -
getOptimizerHint
-
getOptimizerHintPlace
-
getOptimizerHintBracket
-
isSupportTableHint
public abstract boolean isSupportTableHint() -
getTableHintBracket
-
getDataTypeOf
-
getRdbTypeAdapter
-
getRdbTypeAdapter
-
toSqlExp
-
setParameter
- 例外:
SQLException
-
toDateExpression
-
toTimeExpression
-
toTimeStampExpression
-
sanitize
-
resolveFunction
-
resolveAggregateFunction
public final <T extends Aggregate> AggregateFunctionAdapter<T> resolveAggregateFunction(Class<T> aggClass) -
systimestamp
-
createMultiInsertContext
-
createBulkInsertContext
-
createBulkUpdateContext
-
createBulkDeleteContext
-
getConnection
- 例外:
SQLException
-
getConnection
- 例外:
SQLException
-
seqNextSelectSql
-
isUseSubQueryForIndexJoin
public abstract boolean isUseSubQueryForIndexJoin() -
dual
-
rowLockExpression
-
toLimitSql
-
toLimitSql
-
toLimitSqlBindValue
-
isDuplicateValueException
-
isDeadLock
-
isLockFailed
-
isCastFailed
-
addDate
-
checkStatusQuery
-
sanitizeForLike
SQLのlike文のパターン文字列に設定するエスケープ処理。 '自体のエスケープはしない。- パラメータ:
str-- 戻り値:
-
likePattern
EQLのLikeのパターン文字列で、 %、_、\を\でエスケープされているEQLでの文字列を、RDBネイティブなエスケープ構文に変換する。- パラメータ:
str-- 戻り値:
-
escape
Likeのエスケープ文字指定構文。- 戻り値:
-
tableAlias
-
isSupportGroupingExtention
-
isSupportGroupingExtention
public abstract boolean isSupportGroupingExtention() -
isSupportGroupingExtentionWithOrderBy
public abstract boolean isSupportGroupingExtentionWithOrderBy() -
rollUpStart
-
rollUpEnd
-
appendSortSpecExpression
public abstract void appendSortSpecExpression(StringBuilder sb, CharSequence sortValue, SortSpec.SortType sortType, SortSpec.NullOrderingSpec nullOrderingSpec) -
getListaggDefaultSeparator
-
setListaggDefaultSeparator
-
getRdbTimeZone
-
setRdbTimeZone
-
rdbTimeZone
-
rdbCalendar
-
javaCalendar
-
convertTZ
timezoneを変更したtimestampを取得する関数。 変換前のtimestampはデフォルトタイムゾーン(DBのタイムゾーンもしくはDBセッションのタイムゾーン)と同一である想定。- パラメータ:
to-- 戻り値:
- [0]がpre文字列、[1]がpost文字列
-
upperFunctionName
-
initBlob
-
isEnableInPartitioning
public abstract boolean isEnableInPartitioning() -
getInPartitioningSize
public abstract int getInPartitioningSize() -
isSupportGlobalTemporaryTable
public abstract boolean isSupportGlobalTemporaryTable()global temporary tableをサポートしている場合はtrue- 戻り値:
-
isSupportAutoClearTemporaryTableWhenCommit
public abstract boolean isSupportAutoClearTemporaryTableWhenCommit() -
createLocalTemporaryTable
public abstract String createLocalTemporaryTable(String tableName, String baseTableName, String[] baseColumnName) ローカルなTemporaryTableを作成する。 -
deleteTemporaryTable
TemporaryTableを削除(global temporary tableの場合はデータを削除する)するSQLを生成。- パラメータ:
tableName-- 戻り値:
-
isEnableBindHint
public abstract boolean isEnableBindHint()bindヒント句を有効化するか否か- 戻り値:
-
isAlwaysBind
public abstract boolean isAlwaysBind()EQLをSQLに変換する際、常にバインド変数化するか否か。- 戻り値:
-
getBatchSize
public abstract int getBatchSize()バッチ更新利用する際の推奨バッチサイズ。- 戻り値:
-
getMaxFetchSize
public abstract int getMaxFetchSize() -
getDefaultQueryTimeout
public abstract int getDefaultQueryTimeout() -
getDefaultFetchSize
public abstract int getDefaultFetchSize() -
getThresholdCountOfUsePrepareStatement
public abstract int getThresholdCountOfUsePrepareStatement()複数の更新(追加)を一括で処理する際の、PrepareStatementを利用するか否かを判断するための閾値。- 戻り値:
-
aggregateFunctionName
-
isSupportWindowFunction
public abstract boolean isSupportWindowFunction() -
windowRankFunctionName
-
getMultiTableUpdateMethod
-
getTableNames
public abstract ResultSet getTableNames(String tableNamePattern, Connection con) throws SQLException - 例外:
SQLException
-
getTemplaryTablePrefix
-
createRowLockSql
行ロックのSQLを作成します。DMLの判別はしていません。SELECT文に対してのみ使用してください。
- パラメータ:
sql- 行ロックのSQLを作成するSQL。- 戻り値:
- 行ロックを行うSQL
-
isSupportRowValueConstructor
public boolean isSupportRowValueConstructor()行値構成子(行値式)をサポートしているかを判別します。- 戻り値:
- サポートしている場合は
trueを返します。
-
isNeedFromClauseTableAliasUpdateStatement
public boolean isNeedFromClauseTableAliasUpdateStatement()UPDATE文の表名にエイリアスを使用する場合はFROM句が必要かを判別します。- 戻り値:
- FROM句が必要な場合は
trueを返します。
-
isSupportBlobType
public boolean isSupportBlobType()BLOB型をサポートしているかを判別します。- 戻り値:
- サポートしている場合は
trueを返します。
-
getDefaultOrderByForLimit
LIMIT句のための省略時のOrderBy句を取得します。- 戻り値:
- OrderBy句
-
getViewSubQueryAlias
ビューのサブクエリエイリアスを取得します。- 戻り値:
- エイリアス
-
getMaxViewNameLength
public int getMaxViewNameLength()ビュー名の最大長を取得します。- 戻り値:
- ビュー名の最大長。0未満の場合は無制限。
-
createViewColumnSql
ビューカラムのSQLを作成します。- パラメータ:
colNo- カラム番号colName- カラム名- 戻り値:
- ビューカラムSQL
-
createBinaryViewColumnSql
Binary型のビューカラムのSQLを作成します。- パラメータ:
colName- カラム名lobIdSuffix- ロブIDカラム接尾辞colNum- カラム番号- 戻り値:
- ビューカラムSQL
-
createLongTextViewColumnSql
LongText型のビューカラムのSQLを作成します。- パラメータ:
colName- カラム名lobIdSuffix- LobIDカラム接尾辞colNum- カラム番号- 戻り値:
- ビューカラムSQL
-
toCreateViewDDL
指定のSELECT文をビュー作成DDLにします。- パラメータ:
viewName- ビュー名selectSql- SELECT文withDropView- ビュー削除も含める- 戻り値:
- ビュー作成DDL
-
isNeedMultiTableTrick
public boolean isNeedMultiTableTrick()Multi-Table Trickを利用するか否かを指定。 MySQL用の設定項目。- 戻り値:
-
getMultiTableTrickClauseForUpdate
Multi-Table Trickで利用する句。 MySQL用の設定項目。- 戻り値:
-