How to order entity subclasses by their class type using JPA and Hibernate

Introduction In this article, we are going to see how to order entity subclasses when executing a JPQL query with Hibernate.

How to map table rows to columns using SQL PIVOT or CASE expressions

Introduction While reading the wonderful SQL Antipatterns book by Bill Karwin, which is a great reference for any developer that needs to interact with a Relational Database System, I found an example where the SQL PIVOT clause would work like a charm. In this post, I’m going to explain how to transpose a ResultSet using PIVOT so that rows become columns.