Why You Should Execute jOOQ Queries With jOOQ

Previously on this blog, I've written a post explaining why you should use jOOQ's code generator, despite the possibility of using jOOQ without it. In a similar fashion, as I've answered numerous jOOQ questions on Stack Overflow, where someone used jOOQ to build a query, but then executed it elsewhere, including on: JPA JDBC / … Continue reading Why You Should Execute jOOQ Queries With jOOQ

Nesting Collections With jOOQ 3.14’s SQL/XML or SQL/JSON support

One of the main features of ORMs is M as in Mapping. Libraries like jOOQ help auto-mapping flat or nested database records onto Java classes that have the same structure as the SQL result set. The following has always been possible in jOOQ, assuming PostgreSQL's INFORMATION_SCHEMA (using the generated code from the jOOQ-meta module): class … Continue reading Nesting Collections With jOOQ 3.14’s SQL/XML or SQL/JSON support

Stop Mapping Stuff in Your Middleware. Use SQL’s XML or JSON Operators Instead

It's been a while since I've ranted on this blog, but I was recently challenged by a reddit thread to write about this topic, so here goes... So, you're writing a service that produces some JSON from your database model. What do you need? Let's see: Read a book on DDD Read another book on … Continue reading Stop Mapping Stuff in Your Middleware. Use SQL’s XML or JSON Operators Instead

How to Use jOOQ’s UpdatableRecord for CRUD to Apply a Delta

While jOOQ is not a full fledged ORM (as in an object graph persistence framework), there is still some convenience available to avoid hand-writing boring SQL for every day CRUD. That's the UpdatableRecord API. It has a few very useful features, including: A 1:1 mapping to the underlying table Every UpdatableRecord is mapped on a … Continue reading How to Use jOOQ’s UpdatableRecord for CRUD to Apply a Delta

Type Safe Implicit JOIN Through Path Navigation in jOOQ 3.11

One of the biggest contributors to SQL syntax verbosity is the need to explicitly JOIN every table that somehow contributes to the query, even if that contribution is "trivial". When looking at the Sakila database, an example could be seen easily when fetching customer data: SELECT cu.first_name, cu.last_name, co.country FROM customer AS cu JOIN address … Continue reading Type Safe Implicit JOIN Through Path Navigation in jOOQ 3.11

There is no Such Thing as Object-Relational Impedance Mismatch

Much of the ORM criticism of the last decade missed the point, being inaccurate. By the end of this article, we will conclude with the following: There is no significant difference between the relational (data) model and object oriented models How to come to this conclusion? Read on! How we came to believe in this … Continue reading There is no Such Thing as Object-Relational Impedance Mismatch

Type Safe Queries for JPA’s Native Query API

When you're using JPA - sometimes - JPQL won't do the trick and you'll have to resort to native SQL. From the very beginning, ORMs like Hibernate kept an open "backdoor" for these cases and offered a similar API to Spring's JdbcTemplate, to Apache DbUtils, or to jOOQ for plain SQL. This is useful as … Continue reading Type Safe Queries for JPA’s Native Query API

jOOQ Tuesdays: Vlad Mihalcea Gives Deep Insight into SQL and Hibernate

Welcome to the jOOQ Tuesdays series. In this series, we’ll publish an article on the third Tuesday every other month where we interview someone we find exciting in our industry from a jOOQ perspective. This includes people who work with SQL, Java, Open Source, and a variety of other related topics. We have the pleasure … Continue reading jOOQ Tuesdays: Vlad Mihalcea Gives Deep Insight into SQL and Hibernate

jOOQ vs. Hibernate: When to Choose Which

Hibernate has become a de-facto standard in the Java ecosystem, and after the fact, also an actual JavaEE standard implementation if standards matter to you, and if you put the JCP on the same level with ISO, ANSI, IEEE, etc. This article does not intended to discuss standards, but visions. Hibernate shares JPA's vision of … Continue reading jOOQ vs. Hibernate: When to Choose Which

jOOQ vs. Slick – Pros and Cons of Each Approach

Every framework introduces a new compromise. A compromise that is introduced because the framework makes some assumptions about how you'd like to interact with your software infrastructure. An example of where this compromise has struck users recently is the discussion "Are Slick queries generally isomorphic to the SQL queries?". And, of course, the answer is: … Continue reading jOOQ vs. Slick – Pros and Cons of Each Approach