Package org.apache.torque.sql
Class SqlBuilderTest
java.lang.Object
org.apache.torque.BaseTestCase
org.apache.torque.sql.SqlBuilderTest
Tests for SqlExpression
- Version:
- $Id: SqlBuilderTest.java 1917245 2024-04-21 14:06:23Z tv $
- Author:
- Martin Poeschl, Scott Eade
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
Fields inherited from class org.apache.torque.BaseTestCase
CONFIG_FILE, database, databaseMap, databaseMysql, databaseOracle, databasePostgresql, integerColumnMap, stringColumnMap, stringColumnMap2, stringColumnMap3, tableMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidTest where condition with several ANDs compairing against Strings.voidTest where condition with several ANDs compairing against Strings.voidTest the andVerbatimSql method with null replacements.voidTest the andVerbatimSql method with from Columns.voidTest the andVerbatimSql method with replacements.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidTests that an enum which does not have a getValue() method cannot be added as select value.voidvoidvoidvoidvoidvoidvoidvoidvoidTest that unknown columns are treated case-insensitive if ignoreCase is set.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidTests that a subselect can be added to the from clause.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidtestLike()voidvoidvoidvoidTest whether LIKE clauses with Escapes are built correctly.voidTest whether LIKE clauses with Escapes are built correctly in Oracle.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidTest where condition with several ORs compairing against Strings.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidTest where condition with several ORs compairing against Strings.voidTest the orVerbatimSql method with null replacements.voidTest the orVerbatimSql method with from Columns.voidTest the orVerbatimSql method with replacements.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidTest the whereVerbatimSql method with null replacements.voidTest the whereVerbatimSql method with from Columns.voidTest the whereVerbatimSql method with replacements.Methods inherited from class org.apache.torque.BaseTestCase
setUp
-
Constructor Details
-
SqlBuilderTest
public SqlBuilderTest()
-
-
Method Details
-
testAndString
Test where condition with several ANDs compairing against Strings.- Throws:
Exception
-
testOrString
Test where condition with several ORs compairing against Strings.- Throws:
Exception
-
testAndCriterions
Test where condition with several ANDs compairing against Strings.- Throws:
Exception
-
testOrCriterions
Test where condition with several ORs compairing against Strings.- Throws:
Exception
-
testAndVerbatimSqlReplacementNull
Test the andVerbatimSql method with null replacements.- Throws:
Exception
-
testAndVerbatimSqlWithReplacements
Test the andVerbatimSql method with replacements.- Throws:
Exception
-
testAndVerbatimSqlWithFromColumns
Test the andVerbatimSql method with from Columns.- Throws:
Exception
-
testOrVerbatimSqlReplacementNull
Test the orVerbatimSql method with null replacements.- Throws:
Exception
-
testOrVerbatimSqlWithReplacements
Test the orVerbatimSql method with replacements.- Throws:
Exception
-
testOrVerbatimSqlWithFromColumns
Test the orVerbatimSql method with from Columns.- Throws:
Exception
-
testWhereVerbatimSqlReplacementNull
Test the whereVerbatimSql method with null replacements.- Throws:
Exception
-
testWhereVerbatimSqlWithReplacements
Test the whereVerbatimSql method with replacements.- Throws:
Exception
-
testWhereVerbatimSqlWithFromColumns
Test the whereVerbatimSql method with from Columns.- Throws:
Exception
-
testignoreCaseUnknownColumnType
Test that unknown columns are treated case-insensitive if ignoreCase is set.- Throws:
Exception
-
testIgnoreCaseStringColumnType
- Throws:
Exception
-
testIgnoreCaseIntegerColumnType
- Throws:
Exception
-
testOrderByDesc
- Throws:
TorqueException
-
testOrderByAsc
- Throws:
Exception
-
testOrderByNullColumn
- Throws:
Exception
-
testOrderByMultiple
- Throws:
Exception
-
testOrderByWithDefaultSchema
- Throws:
Exception
-
testOrderByWithFunction
- Throws:
Exception
-
testOrderByWithAsColumn
- Throws:
Exception
-
testOrderByWithAsColumnIgnoreCase
- Throws:
Exception
-
testOrderByWithAsColumnAndAliasIgnoreCase
- Throws:
Exception
-
testOrderByAscendingIgnoreCaseString
- Throws:
Exception
-
testOrderByAscendingIgnoreCaseInteger
- Throws:
Exception
-
testOrderByAscendingIgnoreCaseStringInCriteria
- Throws:
Exception
-
testOrderByAscendingIgnoreCaseIntegerInCriteria
- Throws:
Exception
-
testOrderByDescendingIgnoreCaseString
- Throws:
Exception
-
testOrderByDescendingIgnoreCaseInteger
- Throws:
Exception
-
testOrderByDescendingIgnoreCaseStringInCriteria
- Throws:
Exception
-
testOrderByDescendingIgnoreCaseIntegerInCriteria
- Throws:
Exception
-
testAlias
- Throws:
Exception
-
testAliasWithDefaultSchema
- Throws:
Exception
-
testAliasWithIgnoreCaseUnknownColumnType
- Throws:
Exception
-
testAliasWithSubquery
- Throws:
Exception
-
testAliasWithSubqueryAndReplacements
- Throws:
Exception
-
testAliasWithIgnoreCaseStringColumnType
- Throws:
Exception
-
testAliasWithIgnoreCaseIntegerColumnType
- Throws:
Exception
-
testAliasWithIgnoreCaseStringColumnTypeAndDefaultSchema
- Throws:
Exception
-
testAliasWithIgnoreCaseIntegerColumnTypeAndDefaultSchema
- Throws:
Exception
-
testAsColumn
- Throws:
Exception
-
testAsColumnWithIgnoreCaseUnknownColumn
- Throws:
Exception
-
testAsColumnWithIgnoreCaseStringColumn
- Throws:
Exception
-
testAsColumnWithIgnoreCaseIntegerColumn
- Throws:
Exception
-
testAsColumnWithIgnoreCaseStringColumnAndDefaultSchema
- Throws:
Exception
-
testAsColumnWithIgnoreCaseIntegerColumnAndDefaultSchema
- Throws:
Exception
-
testInnerJoinImplicit
- Throws:
Exception
-
testInnerJoinImplicitWithComparison
- Throws:
Exception
-
testInnerJoinExplicit
- Throws:
Exception
-
testInnerJoinWithExcplicitExistingRightTable
- Throws:
Exception
-
testInnerJoinWithExcplicitExistingRightTableAndOperator
- Throws:
Exception
-
testInnerJoinExcplicitWithExistingRightAndLeftTable
- Throws:
Exception
-
testInnerJoinExplicitWithComplicatedCondition
- Throws:
Exception
-
testInnerJoinExplicitWithSubselect
Tests that a subselect can be added to the from clause.- Throws:
Exception- if an error occurs
-
testInnerJoinWithJoinCriteriaAndDefaultSchema
- Throws:
Exception
-
testLeftJoin
- Throws:
Exception
-
testLeftJoinWithExistingRightTable
- Throws:
Exception
-
testRightJoin
- Throws:
Exception
-
testRightJoinWithExistingRightTable
- Throws:
Exception
-
testInnerJoinImplicitWithAlias
- Throws:
Exception
-
testInnerJoinImplicitWithAliasAndAsColumn
- Throws:
Exception
-
testInnerJoinImplicitWithDefaultSchema
- Throws:
Exception
-
testInnerJoinImplicitWithAliasAndDefaultSchema
- Throws:
Exception
-
testInnerJoinImplicitWithAliasAndSchema
- Throws:
Exception
-
testInnerJoinImplicitWithSubqueryAndReplacements
- Throws:
Exception
-
testInnerJoinImplicitWithComplicatedCondition
- Throws:
Exception
-
testDistinct
- Throws:
Exception
-
testGroupBy
- Throws:
Exception
-
testLimitPostgresql
- Throws:
Exception
-
testOffsetPostgresql
- Throws:
Exception
-
testLimitOffsetPostgresql
- Throws:
Exception
-
testLimitMysql
- Throws:
Exception
-
testOffsetMysql
- Throws:
Exception
-
testLimitOffsetMysql
- Throws:
Exception
-
testLimitOracle
- Throws:
Exception
-
testOffsetOracle
- Throws:
Exception
-
testLimitOffsetOracle
- Throws:
Exception
-
testSelectForUpdate
- Throws:
Exception
-
testHaving
- Throws:
Exception
-
testSelectColumnWithoutTable
- Throws:
Exception
-
testCriterionCustomSql
- Throws:
Exception
-
testLvalueIsObject
- Throws:
Exception
-
testCurrentDate
- Throws:
Exception
-
testCurrentTime
- Throws:
Exception
-
testCurrentTimestamp
- Throws:
Exception
-
testObjectKey
- Throws:
Exception
-
testNullValue
- Throws:
Exception
-
testNullValueNotEqual
- Throws:
Exception
-
testNullValueAltNotEqual
- Throws:
Exception
-
testIsNull
- Throws:
Exception
-
testIsNotNull
- Throws:
Exception
-
testSubselect
- Throws:
Exception
-
testSubselectReferenceOuterTable
- Throws:
Exception
-
testLike
- Throws:
Exception
-
testLikeWithEscape
Test whether LIKE clauses with Escapes are built correctly.- Throws:
TorqueException
-
testLikeWithEscapeOracle
Test whether LIKE clauses with Escapes are built correctly in Oracle. Oracle needs to have an ESCAPE clause- Throws:
TorqueException
-
testLikeIgnoreCase
- Throws:
Exception
-
testLikeIgnoreCaseNoWildcard
- Throws:
Exception
-
testLikeInteger
- Throws:
TorqueException
-
testNotLike
- Throws:
Exception
-
testNotLikeIgnoreCase
- Throws:
Exception
-
testNotLikeIgnoreCaseNoWildcard
- Throws:
Exception
-
testIlike
- Throws:
Exception
-
testIlikeNoWildcard
- Throws:
Exception
-
testNotIlike
- Throws:
Exception
-
testNotIlikeNoWildcard
- Throws:
Exception
-
testLvalueString
- Throws:
Exception
-
testLvalueNull
- Throws:
Exception
-
testLvalueCriteria
- Throws:
Exception
-
testInArray
- Throws:
Exception
-
testInArrayIgnoreCase
- Throws:
Exception
-
testInList
- Throws:
Exception
-
testInListIgnoreCase
- Throws:
Exception
-
testNotInList
- Throws:
Exception
-
testInLargeArray
- Throws:
TorqueException
-
testInString
- Throws:
Exception
-
testFromElementsSetExplicitly
- Throws:
Exception
-
testFromElementsSetExplicitlyAsString
- Throws:
Exception
-
testUnion
- Throws:
Exception
-
testUnionAll
- Throws:
Exception
-
testExcept
- Throws:
Exception
-
testExceptAll
- Throws:
Exception
-
testIntersect
- Throws:
Exception
-
testIntersectAll
- Throws:
Exception
-
testUnionOrderByLimitOffset
- Throws:
Exception
-
testSetOperationBraces
- Throws:
Exception
-
testEnumValues
- Throws:
Exception
-
testEnumValuesNoGetValueMethod
Tests that an enum which does not have a getValue() method cannot be added as select value.- Throws:
Exception
-