Fix bug in archiving date.
This commit is contained in:
parent
59648da7a3
commit
4b211d8190
1 changed files with 5 additions and 4 deletions
|
@ -108,7 +108,8 @@ public class SQLSikevaDB implements SikevaDB {
|
||||||
//
|
//
|
||||||
connection = getConnection();
|
connection = getConnection();
|
||||||
connection.setAutoCommit(true);
|
connection.setAutoCommit(true);
|
||||||
statement = connection.prepareStatement("UPDATE sikevadb_elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY IS NULL");
|
statement = connection
|
||||||
|
.prepareStatement("UPDATE sikevadb_elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY IS NULL AND ARCHIVE_DATE IS NULL");
|
||||||
|
|
||||||
statement.setTimestamp(1, toTimestamp(element.getArchiveDate()));
|
statement.setTimestamp(1, toTimestamp(element.getArchiveDate()));
|
||||||
statement.setString(2, element.getKey());
|
statement.setString(2, element.getKey());
|
||||||
|
@ -147,7 +148,7 @@ public class SQLSikevaDB implements SikevaDB {
|
||||||
//
|
//
|
||||||
connection = getConnection();
|
connection = getConnection();
|
||||||
connection.setAutoCommit(true);
|
connection.setAutoCommit(true);
|
||||||
statement = connection.prepareStatement("UPDATE sikevadb_elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY=?");
|
statement = connection.prepareStatement("UPDATE sikevadb_elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY=? AND ARCHIVE_DATE IS NULL");
|
||||||
|
|
||||||
statement.setTimestamp(1, toTimestamp(element.getArchiveDate()));
|
statement.setTimestamp(1, toTimestamp(element.getArchiveDate()));
|
||||||
statement.setString(2, element.getKey());
|
statement.setString(2, element.getKey());
|
||||||
|
@ -1715,7 +1716,7 @@ public class SQLSikevaDB implements SikevaDB {
|
||||||
connection.setAutoCommit(false);
|
connection.setAutoCommit(false);
|
||||||
|
|
||||||
// Archive existing element.
|
// Archive existing element.
|
||||||
statement = connection.prepareStatement("UPDATE sikevadb_elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY IS NULL");
|
statement = connection.prepareStatement("UPDATE sikevadb_elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY IS NULL AND ARCHIVE_DATE IS NULL");
|
||||||
|
|
||||||
statement.setTimestamp(1, toTimestamp(element.getEditionDate()));
|
statement.setTimestamp(1, toTimestamp(element.getEditionDate()));
|
||||||
statement.setString(2, element.getKey());
|
statement.setString(2, element.getKey());
|
||||||
|
@ -1784,7 +1785,7 @@ public class SQLSikevaDB implements SikevaDB {
|
||||||
connection.setAutoCommit(false);
|
connection.setAutoCommit(false);
|
||||||
|
|
||||||
// Archive existing element.
|
// Archive existing element.
|
||||||
statement = connection.prepareStatement("UPDATE sikevadb_elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY=?");
|
statement = connection.prepareStatement("UPDATE sikevadb_elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY=? AND ARCHIVE_DATE IS NULL");
|
||||||
|
|
||||||
statement.setTimestamp(1, toTimestamp(element.getEditionDate()));
|
statement.setTimestamp(1, toTimestamp(element.getEditionDate()));
|
||||||
statement.setString(2, element.getKey());
|
statement.setString(2, element.getKey());
|
||||||
|
|
Loading…
Reference in a new issue