Package org.assertj.db.type
Class Changes
- All Implemented Interfaces:
DbElement,WithColumnLetterCase,WithLetterCase,WithPrimaryKeyLetterCase,WithTableLetterCase
Changes in the database.
A Changes should be constructed by the fluent builder Changes.Builder from a AssertDbConnection instance.
Examples of instantiation :
-
This
Changesdetect all changes in database.AssertDbConnection connection = AssertDbConnectionFactory.of(dataSource).create(); Changes changes = connection.changes().build(); changes.setStartPointNow(); .... do some DB updates .... changes.setEndPointNow(); assertThat(changes)..... -
This
Changesdetect changes for only two table.AssertDbConnection connection = AssertDbConnectionFactory.of(dataSource).create(); Changes changes = connection.changes().table("movie").table("song").build(); -
This
Changesdetect changes for row returned by a SQL query.AssertDbConnection connection = AssertDbConnectionFactory.of(dataSource).create(); Changes changes = connection.changes().request("select * from movie;").build();
- Author:
- Régis Pouiller, Julien Roy
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.assertj.db.type.AbstractDbElement
myself -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of the changes.getChangesOfTable(String tableName) ReturnsChangesonly on the table name in parameter.getChangesOfType(ChangeType changeType) ReturnsChangesonly on the change type in parameter.Returns theRequest.Returns theRequestat end point.Returns theRequestat start point.Returns the list of theTables at end point.Returns the list of theTables at start point.Returns the list ofTable.Sets the end point for comparison.Sets the start point for comparison.Methods inherited from class org.assertj.db.type.AbstractDbElement
getColumnLetterCase, getConnection, getConnectionProvider, getMetaData, getPrimaryKeyLetterCase, getTableLetterCase
-
Method Details
-
getTablesList
Returns the list ofTable.- Returns:
- The list of
Table.
-
getRequest
Returns theRequest.- Returns:
- The
Request.
-
getTablesAtStartPointList
Returns the list of theTables at start point.- Returns:
- The list of the
Tables at start point. - See Also:
-
getTablesAtEndPointList
Returns the list of theTables at end point.- Returns:
- The list of the
Tables at end point. - See Also:
-
getRequestAtStartPoint
Returns theRequestat start point.- Returns:
- The
Requestat start point. - See Also:
-
getRequestAtEndPoint
Returns theRequestat end point.- Returns:
- The
Requestat end point. - See Also:
-
setStartPointNow
Sets the start point for comparison.- Returns:
thisactual instance.
-
setEndPointNow
Sets the end point for comparison.- Returns:
thisactual instance.- Throws:
AssertJDBException- If the start point is not set
-
getChangesList
Returns the list of the changes.- Returns:
- The list of the changes.
- Throws:
AssertJDBException- If the changes are on all the tables and if the number of tables change between the start point and the end point. It is normally impossible.
-
getChangesOfTable
ReturnsChangesonly on the table name in parameter.- Parameters:
tableName- The table name- Returns:
Changesinstance.
-
getChangesOfType
ReturnsChangesonly on the change type in parameter.- Parameters:
changeType- The change type- Returns:
Changesinstance.
-