Slide 1

Slide 1 text

Simon Martinelli Do you really need Hibernate?

Slide 2

Slide 2 text

• 30 years of Software Engineering • Java for 25 years • Self-employed since 2009 • University teacher for 18 years • JUG Switzerland, Location Bern About Me

Slide 3

Slide 3 text

JTAF - Track and Field - https://jtaf.ch

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

• Most conceptual differences between JPA and jOOQ are not technology-specific, but a matter of how you think about your database interactions • There are two approaches • Working with entity state transitions • Working with data set transformations • Neither approach is "the best" one! Both approaches are better suited to particular use cases JPA vs jOOQ

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

• Example Project • https://github.com/simasch/jooq-examples • Official Documentation • https://jooq.org • jOOQ Demo • https://github.com/jOOQ/demo Where to Start?

Slide 8

Slide 8 text

• jOOQ assumes your database already exists • But it does not assume your database follows any rules imposed by jOOQ regarding the design Database First

Slide 9

Slide 9 text

DB jOOQ Generator Java Classes jOOQ DSL How does jOOQ work?

Slide 10

Slide 10 text

• jOOQ can be used in projects of any size • It was inspired by the requirements of software running on thousands of tables, views, and stored procedures. Queries there were so complex they generated up to 500 lines of Oracle execution plan • I’ve used jOOQ in an ERP product with • ~ 2000 Tables and Views • ~ 5000 Stored Procedures and Functions Does jOOQ scale?

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

jOOQ and JPA

Slide 13

Slide 13 text

• jOOQs superpower • Querying • Reading nested objects • Calling functions/stored procedures • Bulk updates and deletes • JPAs superpower • Entity state transition • Cascading insert, update, delete, and orphan removal And now? Which one to use?

Slide 14

Slide 14 text

Thank you! • Web martinelli.ch • EMail [email protected] • Bluesky @martinelli.ch • LinkedIn https://linkedin.com/in/ simonmartinelli