Articles

Affichage des articles du novembre, 2022

Checking rows integrity by adding a signature column to tables

  Introduction In this tutorial I explain how to add extra checks for data integrity on the row level, by adding a signature column which will contain a signature for all the other row columns. For that purpose I will use spring framework (spring -boot) and hibernate. GitHub repository A full and working example is available on this  GitHub repository Use case If you store some sensitive data you might want to ensure that no one else besides your application has changed it; or else you consider that your data is no longer valid. Let's take this as a starting point for what's next. Assuming that we have a  Payment  entity that having following fields: id  a  Long  represents the id of the row amount  a  BigDecimal  represents the amount paid by the customer date  a  ZonedDateTime  for the payment date and time address  a  String  for the invoicing address To those fields we will add a signature field. signatu...