Thank you very much for your additional feedback, Daniele

2016-04-14 10:29 GMT+02:00 Daniele Antonini <[email protected]>:

> You are right, I've abused of "business logic" term :p
>
> Surely you can move any business logic into the query.
> For services that I built from scratch, I use only jooq implementing
> complex query (with a lot of business logic on top of it)
>

I couldn't resist :) I've recently written a series on the topic for a
partner blog:
-
http://www.vertabelo.com/blog/notes-from-the-lab/why-sql-is-neither-legacy-nor-low-level-but-simply-awesome
-
http://www.vertabelo.com/blog/notes-from-the-lab/business-logic-in-the-database-yes-or-no-it-depends

In conclusion,
> If you have a lot of Java logic traversing your entities and your code
> rely heavily on orn lazy fetching, using jooq to replace the native orm
> behavior is a game over.
>

Yes, I absolutely agree with that. There's a big paradigm shift between the
JPA/ORM and jOOQ/SQL approaches. I also like Mike Hadlow's diagram for this
purpose:
http://mikehadlow.blogspot.ch/2012/06/when-should-i-use-orm.html

[image: Inline-Bild 1]


> If you fetch from db _all_ data you need to perform any business logic you
> can safely replace orm queries with jooq, but you have to deal with mapping.
>

Are you using Java 8 yet? I'm personally convinced that functional
programming will greatly influence the mapping discussion. The existing
annotation-based configurative mapping approach is obsolete in my opinion.
People would really prefer more explicit, functional mapping algorithms.

I'd love to know what other people think, though!


> In both scenarios jooq support for jpql would be great, but I see
> technical problems (maybe it requires a new discussion)
>

Well, it would help remove the QueryDSL dependency. But the original
problem remains. When to "query" the entity graph, and when to query the
database.

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to