PostgreSQL audit logging using triggers
Introduction In this article, we are going to see how we can implement an audit logging mechanism using PostgreSQL database triggers to store the CDC (Change Data Capture) records. Thanks to JSON column types, we can store the row state in a single column, therefore not needing to add a new column in the audit log table every time a new column is being added to the source database table.
SQL ANY Operator – A Beginner’s Guide
Introduction In this article, we are going to see how the ANY operator works in SQL using it with a subquery or a VALUES clause, as well as its NULL value handling behavior.
Bulk Update and Delete with JPA and Hibernate
Introduction JPA and Hibernate allow us to execute bulk update and delete queries so that we can process multiple rows that match the business use case filtering criteria. When modifying multiple records, you have two options. You could either use batch processing or bulk processing. While batch processing is useful when entities are already managed by the current Persistence Context because it can reduce the number of INSERT, UPDATE, or DELETE statements that get executed, bulk processing allows us to modify the underlying database records with a single SQL statement.
JPA AttributeConverter – A Beginner’s Guide
Introduction In this article, we are going to see how the JPA AttributeConverter works and how we can use it to customize the entity attribute to the database column mapping. For instance, we could use a JPA AttributeConverter to map a Java MonthDay to a database DATE column because Hibernate doesn’t offer a built-in MonthDayType to handle this particular mapping.