get(Collec
return annotationAttributes;
}
}
+
+ /**
+ * Utility class to stock the row and columnName of the elements in the DataSet in which there is an Oracle Sequence
+ * to replace.
+ *
+ * @author cachavezley
+ */
+ private class TableValue {
+ private final int row;
+ private final String columnName;
+
+ private TableValue(int row, String columnName) {
+ this.row = row;
+ this.columnName = columnName;
+ }
+
+ private int getRow() {
+ return this.row;
+ }
+
+ private String getColumnName() {
+ return this.columnName;
+ }
+
+ @Override
+ public String toString() {
+ return "TableValue [row=" + this.row + ", columnName=" + this.columnName + "]";
+ }
+ }
}
diff --git a/spring-test-dbunit/src/main/java/com/github/springtestdbunit/annotation/ExpectedDatabase.java b/spring-test-dbunit/src/main/java/com/github/springtestdbunit/annotation/ExpectedDatabase.java
index 2798c417..0e876235 100644
--- a/spring-test-dbunit/src/main/java/com/github/springtestdbunit/annotation/ExpectedDatabase.java
+++ b/spring-test-dbunit/src/main/java/com/github/springtestdbunit/annotation/ExpectedDatabase.java
@@ -51,4 +51,27 @@
* @return Database assertion mode to use.
*/
DatabaseAssertionMode assertionMode() default DatabaseAssertionMode.DEFAULT;
+
+ /**
+ * Flag used to indicate that we want to change the sequence names in an XML file for their values in the database.
+ *
+ *
+ * This allows us to use, for example, an xml file for the dataset that looks like this :
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * The {@link org.dbunit.dataset.IDataSet} however will contain the real ids. Each sequence in the database is only accessed once (to
+ * know its current value), and the rest of the values are calculated based on that value and the number of times
+ * the sequence name is declared in the xml file.
+ *
+ * @return true
if we want to change the sequence names for their values in the database,
+ * false
otherwise
+ */
+ boolean replaceSequenceIds() default false;
}