Package lu.kbra.pclib.db.domain.dialect
Class AbstractSQLStructureVisitor
java.lang.Object
lu.kbra.pclib.db.domain.dialect.AbstractSQLStructureVisitor
- All Implemented Interfaces:
SQLStructureVisitor,SQLStructureVisitorOptionsOwner
- Direct Known Subclasses:
MySQLStructureVisitor,PostgreSQLStructureVisitor,SQLiteStructureVisitor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendWhereGroupOrder(StringBuilder sql, String condition, String[] groupBy, ViewOrderStructure[] orderBy) protected StringbuildAlias(ViewColumnStructure column) protected StringbuildColumn(TableStructure table, ColumnData column, boolean inlinePrimaryKey) protected StringbuildColumnSQL(UnionTableStructure table, ViewColumnStructure column) protected StringbuildColumnSQL(ViewColumnStructure column) protected StringbuildColumnSQL(ViewTableStructure table, ViewColumnStructure column) protected StringbuildConstraint(ConstraintData constraint) protected abstract StringbuildDeferrableForeignKey(ForeignKey.DeferMode deferMode) protected Stringprotected StringbuildGeneratedColumn(ColumnData column) buildQuerySql(SQLQueryable<?> instance, Object[] params, QueryStructure queryStructure) protected StringbuildSelectBody(ViewStructure view) protected voidbuildTransactionOption(TransactionOption option, Set<TransactionOption> options2, List<String> lines) String[]buildTransactionOptions(Set<TransactionOption> options) protected StringbuildUnionSQL(UnionTableStructure table) protected Stringprotected Stringcast(EncodingType<?> encodingType) <B extends SQLQueryable<T>,T extends DatabaseEntry>
Stringcount(B queryable) String[]create(TableStructure table) create(TableStructure table, ColumnData column) String[]create(ViewStructure view) drop(DatabaseStructure databaseStructure) drop(TableStructure tableStructure) drop(ViewStructure tableStructure) protected abstract Stringprotected StringescapeList(String[] columns) protected StringescapeList(ColumnData[] columns) protected abstract Stringprotected ColumnDatafinal Map<DbmsCapability, Boolean> getQueryableName(Class<? extends SQLQueryable<?>> tableClass, Map<String, Object> queryableHints) String[]getQueryableNameParts(Class<? extends SQLQueryable<?>> tableClass, Map<String, Object> queryableHints) <T extends DatabaseEntry>
StringgetTruncateSQL(AbstractDBTable<T> queryable) booleanisRawExpression(String identifier) protected StringjoinKeyword(Table.Type joinType) lockModeToString(LockMode lockMode) qualifiedName(Class<? extends SQLQueryable<?>> tableClass, Map<String, Object> queryableHints) qualifiedName(String value) <B extends AbstractDBTable<T>,T extends DatabaseEntry>
StringsafeDelete(B table, String[] whereColumns) <B extends AbstractDBTable<T>,T extends DatabaseEntry>
StringsafeDelete(B table, String[] whereColumns, int count) <B extends AbstractDBTable<T>,T extends DatabaseEntry>
StringsafeInsert(B table, String[] columns) <B extends SQLQueryable<T>,T extends DatabaseEntry>
StringsafeSelect(B table, String[] whereColumns) <B extends SQLQueryable<T>,T extends DatabaseEntry>
StringsafeSelect(B table, String[] whereColumns, int count) <B extends SQLQueryable<T>,T extends DatabaseEntry>
StringsafeSelect(B table, String[] columns, String[] whereColumns) <B extends SQLQueryable<T>,T extends DatabaseEntry>
StringsafeSelect(B table, String[] columns, String[] whereColumns, int count) <B extends SQLQueryable<T>,T extends DatabaseEntry>
StringsafeSelect(B table, String[] columns, String[] whereColumns, LockMode lockMode) <B extends SQLQueryable<T>,T extends DatabaseEntry>
StringsafeSelect(B table, String[] columns, String[] whereColumns, LockMode lockMode, int count) <B extends SQLQueryable<T>,T extends DatabaseEntry>
StringsafeSelect(SQLQueryable<T> instance, String[] whereColumns, boolean limit, boolean offset) <B extends SQLQueryable<T>,T extends DatabaseEntry>
StringsafeSelect(SQLQueryable<T> instance, String[] columns, String[] whereColumns, boolean limit, boolean offset) <B extends SQLQueryable<T>,T extends DatabaseEntry>
StringsafeSelectCountUniqueCollision(B instance, String[][] uniqueKeys, boolean[][] nullable) <B extends SQLQueryable<T>,T extends DatabaseEntry>
StringsafeSelectUniqueCollision(B instance, String[][] uniqueKeys, boolean[][] nullable) <B extends AbstractDBTable<T>,T extends DatabaseEntry>
StringsafeUpdate(B table, String[] setColumns, String[] whereColumns) <B extends AbstractDBTable<T>,T extends DatabaseEntry>
StringsafeUpdateExpr(B table, String[] setColumns, String[] whereColumns) protected final voidsetCapability(DbmsCapability capability, boolean supported) String[]unqualifyName(@Qualified String qualifiedName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface lu.kbra.pclib.db.domain.dialect.SQLStructureVisitor
create, lastQualifiedName, lastUnqualifiedName, memberToColumnName, qualifiedName, schemaName, statementToString, supportsMethods inherited from interface lu.kbra.pclib.db.domain.dialect.SQLStructureVisitorOptionsOwner
getOption, getOptionOrDefault, getOptionOrDefault, hasOption, setOption, unsertOption
-
Constructor Details
-
AbstractSQLStructureVisitor
protected AbstractSQLStructureVisitor()
-
-
Method Details
-
buildTransactionOptions
- Specified by:
buildTransactionOptionsin interfaceSQLStructureVisitor
-
buildTransactionOption
protected void buildTransactionOption(TransactionOption option, Set<TransactionOption> options2, List<String> lines) -
buildQuerySql
public String buildQuerySql(SQLQueryable<?> instance, Object[] params, QueryStructure queryStructure) - Specified by:
buildQuerySqlin interfaceSQLStructureVisitor
-
cast
-
count
- Specified by:
countin interfaceSQLStructureVisitor
-
create
- Specified by:
createin interfaceSQLStructureVisitor
-
create
- Specified by:
createin interfaceSQLStructureVisitor
-
create
- Specified by:
createin interfaceSQLStructureVisitor
-
drop
- Specified by:
dropin interfaceSQLStructureVisitor
-
drop
- Specified by:
dropin interfaceSQLStructureVisitor
-
drop
- Specified by:
dropin interfaceSQLStructureVisitor
-
getOptions
- Specified by:
getOptionsin interfaceSQLStructureVisitorOptionsOwner
-
getQueryableName
public String getQueryableName(Class<? extends SQLQueryable<?>> tableClass, Map<String, Object> queryableHints) - Specified by:
getQueryableNamein interfaceSQLStructureVisitor
-
getQueryableNameParts
public String[] getQueryableNameParts(Class<? extends SQLQueryable<?>> tableClass, Map<String, Object> queryableHints) - Specified by:
getQueryableNamePartsin interfaceSQLStructureVisitor
-
getTruncateSQL
- Specified by:
getTruncateSQLin interfaceSQLStructureVisitor
-
isRawExpression
-
qualifiedName
public @Qualified String qualifiedName(Class<? extends SQLQueryable<?>> tableClass, Map<String, Object> queryableHints) - Specified by:
qualifiedNamein interfaceSQLStructureVisitor
-
qualifiedName
- Specified by:
qualifiedNamein interfaceSQLStructureVisitor
-
unqualifyName
- Specified by:
unqualifyNamein interfaceSQLStructureVisitor
-
safeDelete
public <B extends AbstractDBTable<T>,T extends DatabaseEntry> String safeDelete(B table, String[] whereColumns) - Specified by:
safeDeletein interfaceSQLStructureVisitor
-
safeDelete
public <B extends AbstractDBTable<T>,T extends DatabaseEntry> String safeDelete(B table, String[] whereColumns, int count) - Specified by:
safeDeletein interfaceSQLStructureVisitor
-
safeInsert
public <B extends AbstractDBTable<T>,T extends DatabaseEntry> String safeInsert(B table, String[] columns) - Specified by:
safeInsertin interfaceSQLStructureVisitor
-
safeSelect
public <B extends SQLQueryable<T>,T extends DatabaseEntry> String safeSelect(B table, String[] whereColumns) - Specified by:
safeSelectin interfaceSQLStructureVisitor
-
safeSelect
public <B extends SQLQueryable<T>,T extends DatabaseEntry> String safeSelect(B table, String[] whereColumns, int count) - Specified by:
safeSelectin interfaceSQLStructureVisitor
-
safeSelect
public <B extends SQLQueryable<T>,T extends DatabaseEntry> String safeSelect(B table, String[] columns, String[] whereColumns, int count) - Specified by:
safeSelectin interfaceSQLStructureVisitor
-
safeSelect
public <B extends SQLQueryable<T>,T extends DatabaseEntry> String safeSelect(B table, String[] columns, String[] whereColumns, LockMode lockMode, int count) - Specified by:
safeSelectin interfaceSQLStructureVisitor
-
safeSelect
public <B extends SQLQueryable<T>,T extends DatabaseEntry> String safeSelect(B table, String[] columns, String[] whereColumns) - Specified by:
safeSelectin interfaceSQLStructureVisitor
-
safeSelect
public <B extends SQLQueryable<T>,T extends DatabaseEntry> String safeSelect(B table, String[] columns, String[] whereColumns, LockMode lockMode) - Specified by:
safeSelectin interfaceSQLStructureVisitor
-
lockModeToString
- Specified by:
lockModeToStringin interfaceSQLStructureVisitor
-
safeSelect
public <B extends SQLQueryable<T>,T extends DatabaseEntry> String safeSelect(SQLQueryable<T> instance, String[] whereColumns, boolean limit, boolean offset) - Specified by:
safeSelectin interfaceSQLStructureVisitor
-
safeSelect
public <B extends SQLQueryable<T>,T extends DatabaseEntry> String safeSelect(SQLQueryable<T> instance, String[] columns, String[] whereColumns, boolean limit, boolean offset) - Specified by:
safeSelectin interfaceSQLStructureVisitor
-
safeSelectCountUniqueCollision
public <B extends SQLQueryable<T>,T extends DatabaseEntry> String safeSelectCountUniqueCollision(B instance, String[][] uniqueKeys, boolean[][] nullable) - Specified by:
safeSelectCountUniqueCollisionin interfaceSQLStructureVisitor
-
safeSelectUniqueCollision
public <B extends SQLQueryable<T>,T extends DatabaseEntry> String safeSelectUniqueCollision(B instance, String[][] uniqueKeys, boolean[][] nullable) - Specified by:
safeSelectUniqueCollisionin interfaceSQLStructureVisitor
-
safeUpdate
public <B extends AbstractDBTable<T>,T extends DatabaseEntry> String safeUpdate(B table, String[] setColumns, String[] whereColumns) - Specified by:
safeUpdatein interfaceSQLStructureVisitor
-
safeUpdateExpr
public <B extends AbstractDBTable<T>,T extends DatabaseEntry> String safeUpdateExpr(B table, String[] setColumns, String[] whereColumns) - Specified by:
safeUpdateExprin interfaceSQLStructureVisitor
-
appendWhereGroupOrder
protected void appendWhereGroupOrder(StringBuilder sql, String condition, String[] groupBy, ViewOrderStructure[] orderBy) -
buildAlias
-
buildColumn
-
buildColumnSQL
-
buildColumnSQL
-
buildColumnSQL
-
buildConstraint
-
buildForeignKey
-
buildDeferrableForeignKey
-
buildGeneratedColumn
-
buildSelectBody
-
buildUnionSQL
-
buildWithSQL
-
escapeEnd
-
escapeList
-
escapeList
-
escapeStart
-
findInlinePrimaryKey
-
getCapabilities
- Specified by:
getCapabilitiesin interfaceSQLStructureVisitor
-
joinKeyword
-
setCapability
-