Over a million developers have joined DZone.

How to Integrate jOOQ with Hibernate

· Java Zone

Easily build powerful user management, authentication, and authorization into your web and mobile applications. Download this Forrester report on the new landscape of Customer Identity and Access Management, brought to you in partnership with Stormpath.

While jOOQ can be an alternative to Hibernate, it doesn’t have to entirely replace Hibernate. Many users have reported positive experiences when combining jOOQ with Hibernate, letting Hibernate do the tedious CRUD work, and jOOQ the complex querying and reporting through its sophisticated, yet intuitive query DSL.

Vlad Mihalcea who has been blogging interesting stuff about SQL and transaction models recently has now published a very nice tutorial on how to use JPA-annotated entities as a grounds for source code generation in jOOQ, through the following steps:

  • Write the annotated entities
  • Generate HSQLDB DDL from those entities
  • Execute the DDL in an HSQLDB instance
  • Run the jOOQ code generator to reverse-engineer the schema

With the above, he’s ready to query entities through JPA/Hibernate or jOOQ in no time.

Read the full blog post here:
http://vladmihalcea.wordpress.com/2013/12/06/jooq-facts-from-jpa-annotations-to-jooq-table-mappings/

The Java Zone is brought to you by Stormpath—a complete, pre-built User Management API. Want to learn how to use JWTs to protect microservices from CSRF and more? Check out this on-demand webinar with our Java Developer Evangelist, Micah Silverman.

Topics:

Published at DZone with permission of Lukas Eder, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}