Skip to content

Instantly share code, notes, and snippets.

@thermz thermz/jOOQ_Simplernate.md Secret
Last active Sep 19, 2016

Embed
What would you like to do?
jOOQ & Simplernate

jOOQ & Simplernate

Reading the main description in README.md of Simplernate, you know that the main Simplernate purpose is to provide 2 kind of syntax. And the second one has something similar to jOOQ, to be honest, the syntax will be very inspired by jOOQ philosofy of "writing SQL in java". Although the DSL in this situation will be only a subset of the SQL-DSL: no groupby / having and no join, for those there is a HQL & native SQL wrapping.

An example of syntax 2 (the syntax is not yet in development, so it can change) :

//Find the first 3 user with name Richard and age > 18 in descending order

List<User> users = select().from(User.class)
                           .where(eq(NAME,"Richard"),gt(AGE,18))
                           .offset(3)
                           .desc()
                           .fetch();

//The where methods take a varargs in input that are Hibernate restrictions.

Conclusion:

  • jOOQ and Simplernate are different projects with different purposes
  • jOOQ is a real persistence layer with a fluent inteface that uses a SQL-like syntax.
  • Simplernate is (will be) an Hibernate wrapper that help developer to query the database using Hibernate ORM. To do this, Simplernate offers a syntax inspired by jOOQ philosofy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.