How to map composite column types with Hibernate
|

How to map composite column types with Hibernate

When most developers design their table and entity models, they create tables that only use basic column types and map these to basic entity attributes. Even though these are the most commonly used types, they are not the only ones supported by modern relational databases and Hibernate. You can also use composite, JSON, and XML…

How to use PostgreSQL’s JSONB data type with Hibernate
| |

How to use PostgreSQL’s JSONB data type with Hibernate

Most databases offer many proprietary features besides the known SQL standard. One example is PostgreSQL’s JSONB data type which allows you to store JSON documents efficiently in a database column. You could, of course, store the JSON document in a text column. That column type is part of the SQL standard. Hibernate and all other…

Using Window Functions with Hibernate 5 & 6
|

Using Window Functions with Hibernate 5 & 6

SQL is an incredibly powerful query language. It provides sheer endless possibilities to extract and transform information. One example of that is a window function. It enables you to perform operations on subsets of the table rows available in your query. The PostgreSQL documentation explains window functions as: A window function performs a calculation across a set…

Spring Data JPA – How to create a custom base repository

Spring Data JPA – How to create a custom base repository

Most developers create their own repositories by adding their queries to one of Spring Data JPA’s standard base repositories, like the JpaRepository or the CrudRepository. These repositories give you a set of standard operations, e.g., to read and write entity objects. It often seems like the obvious choice to define your own repositories based on one of these…