Package org.hibernate.testing.jdbc
Class SQLStatementInspector
java.lang.Object
org.hibernate.testing.jdbc.SQLStatementInspector
- All Implemented Interfaces:
Serializable
,StatementInspector
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
assertExecuted
(String expected) void
assertExecutedCount
(int expected) void
assertIsInsert
(int queryNumber) void
assertIsSelect
(int queryNumber) void
assertIsUpdate
(int queryNumber) void
void
assertNumberOfJoins
(int queryNumber, int expectedNumberOfJoins) void
assertNumberOfJoins
(int queryNumber, SqlAstJoinType joinType, int expectedNumberOfOccurrences) void
assertNumberOfOccurrenceInQuery
(int queryNumber, String toCheck, int expectedNumberOfOccurrences) void
assertNumberOfOccurrenceInQueryNoSpace
(int queryNumber, String toCheck, int expectedNumberOfOccurrences) void
void
clear()
static SQLStatementInspector
extractFromSession
(SessionImplementor session) int
getNumberOfJoins
(int position) Inspect the given SQL command, possibly returning a different SQL command to be used instead.
-
Constructor Details
-
SQLStatementInspector
public SQLStatementInspector()
-
-
Method Details
-
inspect
Description copied from interface:StatementInspector
Inspect the given SQL command, possibly returning a different SQL command to be used instead. Anull
return value is interpreted as if the method had returned its argument.- Specified by:
inspect
in interfaceStatementInspector
- Parameters:
sql
- The SQL to inspect- Returns:
- The processed SQL to use; may be
null
-
getSqlQueries
-
clear
public void clear() -
getNumberOfJoins
public int getNumberOfJoins(int position) -
assertExecuted
-
assertNumberOfJoins
public void assertNumberOfJoins(int queryNumber, int expectedNumberOfJoins) -
assertExecutedCount
public void assertExecutedCount(int expected) -
assertNumberOfJoins
public void assertNumberOfJoins(int queryNumber, SqlAstJoinType joinType, int expectedNumberOfOccurrences) -
assertNumberOfOccurrenceInQuery
public void assertNumberOfOccurrenceInQuery(int queryNumber, String toCheck, int expectedNumberOfOccurrences) -
assertNumberOfOccurrenceInQueryNoSpace
public void assertNumberOfOccurrenceInQueryNoSpace(int queryNumber, String toCheck, int expectedNumberOfOccurrences) -
assertIsSelect
public void assertIsSelect(int queryNumber) -
assertIsInsert
public void assertIsInsert(int queryNumber) -
assertIsUpdate
public void assertIsUpdate(int queryNumber) -
assertNoUpdate
public void assertNoUpdate() -
assertUpdate
public void assertUpdate() -
extractFromSession
-