Package org.hibernate.testing.jdbc
Class SQLStatementInspector
- java.lang.Object
-
- org.hibernate.testing.jdbc.SQLStatementInspector
-
- All Implemented Interfaces:
java.io.Serializable
,StatementInspector
public class SQLStatementInspector extends java.lang.Object implements StatementInspector
- 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 void
assertExecuted(java.lang.String expected)
void
assertExecutedCount(int expected)
void
assertIsInsert(int queryNumber)
void
assertIsSelect(int queryNumber)
void
assertIsUpdate(int queryNumber)
void
assertNoUpdate()
void
assertNumberOfJoins(int queryNumber, int expectedNumberOfJoins)
void
assertNumberOfJoins(int queryNumber, JoinType joinType, int expectedNumberOfOccurrences)
void
assertNumberOfOccurrenceInQuery(int queryNumber, java.lang.String toCheck, int expectedNumberOfOccurrences)
void
assertUpdate()
void
clear()
static SQLStatementInspector
extractFromSession(SessionImplementor session)
int
getNumberOfJoins(int position)
java.util.List<java.lang.String>
getSqlQueries()
java.lang.String
inspect(java.lang.String sql)
Inspect the given SQL, possibly returning a different SQL to be used instead.
-
-
-
Method Detail
-
inspect
public java.lang.String inspect(java.lang.String sql)
Description copied from interface:StatementInspector
Inspect the given SQL, possibly returning a different SQL to be used instead. Note that returningnull
is interpreted as returning the same SQL as was passed.- Specified by:
inspect
in interfaceStatementInspector
- Parameters:
sql
- The SQL to inspect- Returns:
- The SQL to use; may be
null
-
getSqlQueries
public java.util.List<java.lang.String> getSqlQueries()
-
clear
public void clear()
-
getNumberOfJoins
public int getNumberOfJoins(int position)
-
assertExecuted
public void assertExecuted(java.lang.String expected)
-
assertNumberOfJoins
public void assertNumberOfJoins(int queryNumber, int expectedNumberOfJoins)
-
assertExecutedCount
public void assertExecutedCount(int expected)
-
assertNumberOfJoins
public void assertNumberOfJoins(int queryNumber, JoinType joinType, int expectedNumberOfOccurrences)
-
assertNumberOfOccurrenceInQuery
public void assertNumberOfOccurrenceInQuery(int queryNumber, java.lang.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)
-
-