How to Pass a Table Valued Parameter to a T-SQL Function with jOOQ

Microsoft T-SQL supports a language feature called table-valued parameter (TVP), which is a parameter of a table type that can be passed to a stored procedure or function. For example, you may write: CREATE TYPE u_number_table AS TABLE (column_value INTEGER); CREATE FUNCTION f_cross_multiply ( @numbers u_number_table READONLY ) RETURNS @result TABLE ( i1 INTEGER, i2 … Continue reading How to Pass a Table Valued Parameter to a T-SQL Function with jOOQ

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

Cannot resolve symbol ‘VERSION_3_17’ in jOOQ generated code

Starting with jOOQ 3.16 and #12601, there may be a compilation error with a message like this in your jOOQ generated code: [ERROR] .../DefaultCatalog.java:[53,73] cannot find symbol[ERROR] symbol: variable VERSION_3_17[ERROR] location: class org.jooq.Constants Typically, this error is mixed with other compilation errors in generated code. Its purpose is to help troubleshoot these other compilation errors. … Continue reading Cannot resolve symbol ‘VERSION_3_17’ in jOOQ generated code

The Best Way to Call Stored Procedures from Java: With jOOQ

jOOQ is mainly known for its powerful type safe, embedded, dynamic SQL capabilities that are made available through code generation. However, a secondary use case of code generation is to use it for stored procedures (possibly exclusively for stored procedures). Stored procedures are powerful ways of moving complex data processing logic to the server. This … Continue reading The Best Way to Call Stored Procedures from Java: With jOOQ

Why You Should Use jOOQ With Code Generation

I'm answering many jOOQ questions on Stack Overflow, and a lot of times. The problem has the same cause: People not using jOOQ's code generator. The main reason people seem not to be using it, is because it takes some extra time to set up, but as with anything well designed, the initial investment will … Continue reading Why You Should Use jOOQ With Code Generation

Using Testcontainers to Generate jOOQ Code

Database first is at the core of jOOQ's design. jOOQ has been made primarily for classic systems the database is always there and always has been and will never leave. This is because we think "data have mass" https://twitter.com/ChrisRSaxon/status/1093122970254536704 This not only translates to moving logic closer to the data (see our previous posts about … Continue reading Using Testcontainers to Generate jOOQ Code

Using jOOQ 3.14 Synthetic Foreign Keys to Write Implicit Joins on Views

jOOQ has supported one of JPQL's most cool features for a while now: implicit joins. Using jOOQ, you can navigate your to-one relationships in a type safe way, generating LEFT JOIN operations implicitly without the effort of having to keep thinking about join predicates, and the correct join order. Consider this Sakila database query here, … Continue reading Using jOOQ 3.14 Synthetic Foreign Keys to Write Implicit Joins on Views

Truth First, or Why You Should Mostly Implement Database First Designs

In this much overdue article, I will explain why I think that in almost all cases, you should implement a "database first" design in your application's data models, rather than a "Java first" design (or whatever your client language is), the latter approach leading to a long road of pain and suffering, once your project … Continue reading Truth First, or Why You Should Mostly Implement Database First Designs

How to Implement Your Own XJC Plugin to Generate toString(), equals(), and hashCode() Methods

When you work with JAXB to generate Java code from XSD (or *ghasp* WSDL) files, you're going to use the XJC tool, which is shipped with the JDK (at least until JDK 9 - with Jigsaw, it will soon be externalised into its own external dependency). Adding plugins to XJC when running it via Maven … Continue reading How to Implement Your Own XJC Plugin to Generate toString(), equals(), and hashCode() Methods

jOOQ Newsletter: August 15, 2014 – jOOQ 3.5 Outlook

Subscribe to this newsletter here jOOQ 3.5 Outlook We're working hard on the next release. Already 90 issues for jOOQ 3.5 are closed and counting! Today, we're going to look at the highlights of what will be implemented in the next, exciting minor release, due for Q4 2014: Support for new databases Our customers have … Continue reading jOOQ Newsletter: August 15, 2014 – jOOQ 3.5 Outlook