Home Programming 3.16.0 Launch with a brand new Public Question Object Mannequin API, Spatial Assist, YugabyteDB Assist and A lot Extra – Java, SQL and jOOQ.

3.16.0 Launch with a brand new Public Question Object Mannequin API, Spatial Assist, YugabyteDB Assist and A lot Extra – Java, SQL and jOOQ.

0
3.16.0 Launch with a brand new Public Question Object Mannequin API, Spatial Assist, YugabyteDB Assist and A lot Extra – Java, SQL and jOOQ.

[ad_1]

This launch tackles two lengthy standing and complicated function requests that customers
have requested us to supply for a very long time: a public API for manipulating jOOQ’s
question object mannequin (QOM), and spatial assist.

New Question Object Mannequin (QOM)

Each jOOQ question is modeled as an expression tree constructed through our intuitive
DSL. For some use-cases there exist historic mannequin API variations (e.g.
SelectQuery), however these fashions aren’t readable or transformable. We’re now
beginning to provide most of our expression tree mannequin as a public API for customers to
eat and manipulate. Each expression tree ingredient has a corresponding sort
in org.jooq.impl.QOM. Each sort supplies entry to its elements utilizing "$"
prefixed technique names, e.g.:

// Create an expression utilizing the DSL API:
Discipline subject = substring(BOOK.TITLE, 2, 4);

// Entry the expression's internals utilizing the mannequin API
if (subject instanceof QOM.Substring substring) {
    Discipline string = substring.$string();
    Discipline startingPosition = substring.$startingPosition();
    Discipline size = substring.$size();
}

The brand new API is experimental and would possibly change within the subsequent minor launch.

Licensed energy customers will get auxiliary APIs to traverse and remodel the
expression tree, e.g. traversal:

// Comprises 7 question elements 
lengthy count2 = BOOK.ID.eq(1).or(BOOK.ID.eq(2))
    .$traverse(Traversers.gathering(Collectors.counting());

Or alternative:

// Comprises redundant operators
Situation c = not(not(BOOK.ID.eq(1)));
System.out.println(c.$exchange(q ->
    q instanceof QOM.Not n1 && n1.$arg1() instanceof QOM.Not n2
        ? n2.$arg1()
        : q
));

The above prints the next, having eliminated the redundant NOT operators:

"BOOK"."ID" = 1

This new API may be very highly effective for much more refined dynamic SQL use-cases,
similar to:

  • Optimising SQL expressions because the above NOT NOT instance
  • Row stage safety
  • Delicate deletion
  • Shared schema multi tenancy
  • Audit column assist
  • And rather more (keep tuned for future blogs and out-of-the-box transformations)

For more information, see:

Spatial assist

A protracted awaited function that begins delivery to our commercially licensed
prospects is spatial assist. Many dialects assist the ISO/IEC 13249-3:2016 SQL
normal extension, and at last, so can we.

jOOQ introduces new auxiliary knowledge varieties for GEOMETRY and GEOGRAPHY knowledge to make use of
as standardised bind variables, containing WKB or WKT knowledge, in addition to a
number of out of the field capabilities and predicates.

Future variations will add extra assist for different capabilities and dialects.

New dialect and variations

One other new formally supported SQL dialect has been added to all jOOQ editions
together with the jOOQ Open Supply Version: YugabyteDB. This was a sponsored
integration, thanks very a lot Yugabyte!

Different dialects have upgraded variations, which means:

  • We assist this model in all editions now
  • The jOOQ Open Supply Version now requires this model if relevant

The variations are:

  • Firebird 4.0
  • H2 2.0.202
  • MariaDB 10.6
  • PostgreSQL 14
  • Oracle 21c

Computed and readonly columns together with ROWID

A variety of dialects assist computed columns (“generated” columns), and we now
assist these as properly in jOOQ. For many use-cases, this doesn’t have an effect on jOOQ
utilization, however particularly when writing CRUD code, the brand new readonly column function
might be very useful to keep away from having to exclude computed columns manually from
the CRUD operation.

This additionally features a new, improved ROWID assist, the place customers can select to work
with an artificial ROWID column as a substitute of the first key, when performing CRUD
operations.

All of those options can be found within the business jOOQ editions.

Jakarta EE

We’ve moved on from Java EE to Jakarta EE dependencies. This transformation is
at present backwards incompatible as a result of:

  • It drastically facilitates sustaining the associated code
  • It prevents tons of consumer issues ensuing from having each dependencies
  • We’re not truly integrating tightly with Java EE / Jakarta EE

The next Jakarta EE modules are affected:

  • JAXB, which we’re utilizing to load our configuration objects.
  • Validation, whose annotations might be generated by the code generator.
  • JPA, which is utilized by the DefaultRecordMapper and the JPADatabase

If this breaking change causes points, please get in contact at
https://github.com/jOOQ/jOOQ/points/9641

Varied enhancements

As with each minor launch, a number of smaller enhancements have been
carried out. Some highlights embrace:

  • PostgreSQL procedures at the moment are supported in code technology and at runtime.
  • SQLite JSON assist has been added, which incorporates the MULTISET emulation!
  • A variety of MULTISET / ROW enhancements have been carried out
  • R2DBC 0.9 has been launched, and we’ve upgraded our dependency
  • The Java 17 distribution now requires Java 17 as a substitute of Java 16
  • Pre jOOQ 3.6 deprecations have been eliminated

Full launch notes right here

[ad_2]

Supply hyperlink

LEAVE A REPLY

Please enter your comment!
Please enter your name here