On Fri, Sep 21, 2012 at 7:04 AM, Lukas Eder <[email protected]> wrote:
> Hello, > > > Can't say... I hate JPA annotations soooo much. However if they are > > generated, perhaps I could live with. > > Well, I understand those feelings, but JPA annotations are quite > expressive. In my opinion, JPA went wrong in the way they assumed that > SQL should be drastically reduced to JPQL, which in turn can be > generated from those annotations. But the annotations themselves can > be useful (to some) > > I agree > > > > Because jooq current API is SQL centered and does its job well perhaps it > > should stick to that, I would say that an llblgen style entity/graph > system > > built on top of that may actually be better than adapting the current > API to > > add the necessary logic. > > Precisely. jOOQ's SQL API will stick to SQL. The "mapping" API (or > perhaps, ORM API) is only contained in org.jooq.Result and > org.jooq.Record. The two will not interfere. > > I think what I would need out of jOOQ ResultSet mapping are the ability to map children from the result set automagically. I did this before with result set column "dotted" naming conventions and the Jackson ObjectMapper. I was contemplating generating constants from the java beans to make this column labels easier ie ( table1.col1 AS "parentBean.childBean.childProperty"). I guess what I'm saying (and I think Lukas is also) is jOOQ does not need its SQL generation changed. We just need better ResultSet mapping and maybe some utility libraries to help generate the ManyToOne SQL (like the constants mentioned above). Right now its rather difficult to load objects with ManyToOne (ie the table has column with ID referencing another table) with jOOQ. I propose a jOOQ extension (that I already wrote for Spring as a RowMapper) that will translate the ResultSet's to a hierarchy of Maps. BUT I don't see where I can inject custom data conversion (ie Calendar to Timestamp) etc. I think loading ManyToOne paths would fit most peoples needs considering most people with modern Web Apps are returning JSON which is just a hierarchy of maps (except for the OneToMany lists). This could be done outside the query generation and in the result set handling. -- CTO Evocatus, Inc. (evocatus.com) (twitter) @agentgt (cell) 781-883-5182
