As I'm mostly using Oracle, IDENTITY columns were not so important to me up until I started to support them in jOOQ. Then, I found that yet again, there are many differences between various databases in how they handle IDENTITY columns in DDL and in DML. In SQL, there are essentially three orthogonal concepts of … Continue reading Subtle SQL differences: IDENTITY columns
Category: jooq-development
This category contains posts related to current developments of jOOQ
jOOQ’s fluent API in BNF notation
I have recently posted an article about how to generally design a fluent API in Java. By fluent API, I don't mean simple constructs such as new Builder().withSomething(x) .withSomethingElse(y) .withSomething(z) .withAnotherThing(xx); The above is just simple method-chaining, without any sophisticated formal language definition. Most often in method-chaining contexts, the order of method calls is irrelevant … Continue reading jOOQ’s fluent API in BNF notation
Let’s revise the SQL FROM clause
Intuitive SQL SQL is extremely simple and yet at times, tricky. Most SQL developers have an intuitive (as opposed to formal) understanding of how the language works, for two reasons: It is designed "intuitively", like a natural language. Maybe that keeps us from studying it more formally The formal language specification is not really freely … Continue reading Let’s revise the SQL FROM clause
The Java Fluent API Designer Crash Course
Ever since Martin Fowler's talks about fluent interfaces, people have started chaining methods all over the place, creating fluent API's (or DSLs) for every possible use case. In principle, almost every type of DSL can be mapped to Java. Let's have a look at how this can be done DSL rules DSLs (Domain Specific Languages) … Continue reading The Java Fluent API Designer Crash Course
SQL in Scala, where jOOQ could go
I have recently blogged about how simple it is to integrate jOOQ into Scala. See the full blog post here: https://blog.jooq.org/the-ultimate-sql-dsl-jooq-in-scala/ I'm more and more thrilled by that option, as Scala is one of the fastest emerging JVM languages nowadays. The plain integration of a Java library in Scala leaves some open questions. jOOQ knows … Continue reading SQL in Scala, where jOOQ could go
The ultimate SQL-DSL: jOOQ in Scala
I've recently come across some advertising for the new upcoming version of Scala IDE for Eclipse, which made me remember my college programming lessons at the EPFL Laboratoire des Méthodes de Programmation (LAMP), the origin of the Scala language. Back then, Scala appeared quite freaky. Very elegant, a bit inefficient, somewhat dogmatic. It was much … Continue reading The ultimate SQL-DSL: jOOQ in Scala
Arcane magic with the SQL:2003 MERGE statement
Every now and then, we feel awkward about having to distinguish INSERT from UPDATE for any of the following reasons: We have to issue at least two statements We have to think about performance We have to think about race conditions We have to choose between [UPDATE; IF UPDATE_COUNT = 0 THEN INSERT] and [INSERT; … Continue reading Arcane magic with the SQL:2003 MERGE statement
GROUP BY ROLLUP / CUBE
Every now and then, you come across a requirement that will bring you to your SQL limits. Many of us probably give up early and calculate stuff in Java / [or your language]. Instead, it might've been so easy and fast to do with SQL. If you're working with an advanced database, such as DB2, … Continue reading GROUP BY ROLLUP / CUBE
Overload API methods with care – the sequel
I had recently blogged about funny issues that arise when overloading API methods with generics involved: https://blog.jooq.org/overload-api-methods-with-care/ I promised a sequel as I have encountered more trouble than that, so here it is. The trouble with generics and varargs Varargs are another great feature introduced in Java 5. While being merely syntactic sugar, you can … Continue reading Overload API methods with care – the sequel
jOOQ-meta. A “hard-core SQL” proof of concept
jOOQ-meta is more than just meta data navigation for your database schema. It is also a proof of concept for the more complex jOOQ queries. It is easy for you users to believe that the simple vanilla queries of this form will work: create.selectFrom(AUTHOR).where(LAST_NAME.equal("Cohen")); But jOOQ claims to be a "hard-core SQL library". A "hard-core … Continue reading jOOQ-meta. A “hard-core SQL” proof of concept
