Hello

In my application I would like to use POJOs to transfer data via SOAP or 
modify values with JSF and already figured out how to generate them with 
JOOQ.
As the optionally generated DAO classes do not offer very much functions I 
guessed that I can live without and use the ActiveRecord classes to
retrieve and store POJOs like this:

  // Load via ActiveRecord and store into POJO
  Author a = jooq.selectFrom(AUTHOR).fetchOne().into(Author.class);
  ...
  // Later, load current values from DB, update from POJO and store changes
  AuthorRecord ar2 = 
jooq.selectFrom(AUTHOR).where(AUTHOR.ID.eq(a.getId())).fetchOne();
  ar2.from(a);
  jooq.executeUpdate(ar2);

The Record.from() method will set the "changed" flags for all attributes to 
true, though,
which makes ugly long UPDATE statement..
(Some reason were given in the recent thread about "Dirty checks return...")

My questions are now:
1. Does my approach makes sense or am I unnecessarily strict with my layers 
and using ActiveRecord objects in JSF managed beans or webservices is 
standard practice?
2..Would make sense to add a flag to Record.from() that, if set, only 
alters the "changed" flags of fields whose values differ from their 
originals?

best regards,

-christian-





-- 
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/groups/opt_out.

Reply via email to