Reader small image

You're reading from  jOOQ Masterclass

Product typeBook
Published inAug 2022
Reading LevelBeginner
PublisherPackt
ISBN-139781800566897
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Anghel Leonard
Anghel Leonard
author image
Anghel Leonard

Anghel Leonard is a Chief Technology Strategist and independent consultant with 20+ years of experience in the Java ecosystem. In daily work, he is focused on architecting and developing Java distributed applications that empower robust architectures, clean code, and high-performance. Also passionate about coaching, mentoring and technical leadership. He is the author of several books, videos and dozens of articles related to Java technologies.
Read more about Anghel Leonard

Right arrow

Highlighting that jOOQ emphasizes SQL syntax correctness

One of the coolest features of jOOQ consists of the fact that jOOQ doesn't allow us to write bad SQL syntax. If you aren't an SQL expert or simply have issues with SQL-specific syntax, then all you have to do is to let jOOQ guide you step by step.

Having a fluent API for chaining methods to obtain a SQL is cool, but having a fluent API that emphasizes SQL syntax correctness is the coolest. jOOQ knows exactly how the query parts fit the puzzle and will help you via your IDE.

For instance, let's assume that we accidentally wrote the following bad SQLs. Let's start with an SQL that misses the ON clause:

ctx.select(EMPLOYEE.JOB_TITLE, 
           EMPLOYEE.OFFICE_CODE, SALE.SALE_)
   .from(EMPLOYEE)
   .join(SALE)
   // "on" clause is missing here
   .fetch();

The IDE signals...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
jOOQ Masterclass
Published in: Aug 2022Publisher: PacktISBN-13: 9781800566897

Author (1)

author image
Anghel Leonard

Anghel Leonard is a Chief Technology Strategist and independent consultant with 20+ years of experience in the Java ecosystem. In daily work, he is focused on architecting and developing Java distributed applications that empower robust architectures, clean code, and high-performance. Also passionate about coaching, mentoring and technical leadership. He is the author of several books, videos and dozens of articles related to Java technologies.
Read more about Anghel Leonard