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
Changes
detect 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
Changes
detect changes for only two table.AssertDbConnection connection = AssertDbConnectionFactory.of(dataSource).create(); Changes changes = connection.changes().table("movie").table("song").build();
-
This
Changes
detect 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) ReturnsChanges
only on the table name in parameter.getChangesOfType
(ChangeType changeType) ReturnsChanges
only on the change type in parameter.Returns theRequest
.Returns theRequest
at end point.Returns theRequest
at start point.Returns the list of theTable
s at end point.Returns the list of theTable
s 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 theTable
s at start point.- Returns:
- The list of the
Table
s at start point. - See Also:
-
getTablesAtEndPointList
Returns the list of theTable
s at end point.- Returns:
- The list of the
Table
s at end point. - See Also:
-
getRequestAtStartPoint
Returns theRequest
at start point.- Returns:
- The
Request
at start point. - See Also:
-
getRequestAtEndPoint
Returns theRequest
at end point.- Returns:
- The
Request
at end point. - See Also:
-
setStartPointNow
Sets the start point for comparison.- Returns:
this
actual instance.
-
setEndPointNow
Sets the end point for comparison.- Returns:
this
actual 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
ReturnsChanges
only on the table name in parameter.- Parameters:
tableName
- The table name- Returns:
Changes
instance.
-
getChangesOfType
ReturnsChanges
only on the change type in parameter.- Parameters:
changeType
- The change type- Returns:
Changes
instance.
-