Skip to content

Commit

Permalink
Make h2 trigger more robuts
Browse files Browse the repository at this point in the history
  • Loading branch information
gmokki committed Dec 20, 2021
1 parent 69ecce0 commit d43ebeb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
public class H2ModifiedColumnTrigger extends TriggerAdapter {
@Override
public void fire(Connection conn, ResultSet oldRow, ResultSet newRow) throws SQLException {
Timestamp oldModified = oldRow.getTimestamp("modified");
Timestamp newModified = newRow.getTimestamp("modified");
Object oldModified = oldRow.getObject("modified");
Object newModified = newRow.getObject("modified");
if (Objects.equals(oldModified, newModified)) {
newRow.updateTimestamp("modified", new Timestamp(currentTimeMillis()));
}
Expand Down

0 comments on commit d43ebeb

Please sign in to comment.