Package org.hibernate.testing.jdbc
Class SQLStatementInspector
- java.lang.Object
- org.hibernate.testing.jdbc.SQLStatementInspector
- All Implemented Interfaces:
Serializable,StatementInspector
public classSQLStatementInspectorextendsObjectimplementsStatementInspector
- See Also:
- Serialized Form
Constructor Summary
Constructors Constructor Description SQLStatementInspector()
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertExecuted(String expected)voidassertExecutedCount(int expected)voidassertIsInsert(int queryNumber)voidassertIsSelect(int queryNumber)voidassertIsUpdate(int queryNumber)voidassertNoUpdate()voidassertNumberOfJoins(int queryNumber, int expectedNumberOfJoins)voidassertNumberOfJoins(int queryNumber,SqlAstJoinType joinType, int expectedNumberOfOccurrences)voidassertNumberOfOccurrenceInQuery(int queryNumber,String toCheck, int expectedNumberOfOccurrences)voidassertNumberOfOccurrenceInQueryNoSpace(int queryNumber,String toCheck, int expectedNumberOfOccurrences)voidassertUpdate()voidclear()staticSQLStatementInspectorextractFromSession(SessionImplementor session)intgetNumberOfJoins(int position)List<String>getSqlQueries()Stringinspect(String sql)Inspect the given SQL command, possibly returning a different SQL command to be used instead.
Method Detail
inspect
public String inspect(String sql)
Description copied from interface:StatementInspectorInspect the given SQL command, possibly returning a different SQL command to be used instead. Anullreturn value is interpreted as if the method had returned its argument.- Specified by:
inspectin interfaceStatementInspector- Parameters:
sql- The SQL to inspect- Returns:
- The processed SQL to use; may be
null
clear
public void clear()
getNumberOfJoins
public int getNumberOfJoins(int position)
assertExecuted
public void assertExecuted(String expected)
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
public static SQLStatementInspector extractFromSession(SessionImplementor session)