2015-04-24 13:16 GMT+02:00 Ben Hood <[email protected]>:

> On Fri, Apr 24, 2015 at 7:54 AM, Lukas Eder <[email protected]> wrote:
> > Hmm, but that has always been the case in previous jOOQ implementations,
> > hasn't it? From what version did you upgrade?
>
> From 3.5.1
>
> I can reproduce the issue by just changing the version of JOOQ in my
> POM, without any other changes.
>
> But I do agree with JOOQ's handling of the particular class definition
> in 3.6.0 - it seems that for some reason it was more lenient in 3.5.1.
>

Hmm, I vaguely remember implementing a change where Record.from() and
Record.into() were "harmonized" to follow the specification of
DefaultRecordMapper... But I cannot seem to find the appropriate issue
right now.

I did find it interesting that this was the only issue I ran into with
> the upgrade. Everything else was smooth.
>

Great to know!


> > I'm going to try to translate that lingo to what I think you mean. ;)
> You're
> > talking about this MyBatis API, right?
> > http://adamgent.com/post/30974973820/mybatis-sqlbuilder-rewritten
>
> I should be more careful with what I write.
>
> Note to self: don't use the words "neat" and "playing around with the
> thread local" in the same sentence.
>

;-)


> Yes, I was referring to something I tried out years ago with
> MyBatis/iBatis, and I didn't realize that the project had it changed
> its name.
>

Oh, that happened a while ago! It also moved out of the Apache Foundation,
which is probably why they had to change the name / trademarks, as you can
never really reclaim anything that has gone beyond the singularity of the
Apache Foundation.


> > You can probably do that even better
> > with jOOQ, both with the DSL API, and even more easily with the model
> API:
> >
> http://www.jooq.org/doc/latest/manual/sql-building/sql-statements/dsl-and-non-dsl
> >
> > If you can show an example of what you'd like to achieve, I can show you
> a
> > code example.
>
> This particular use case is (in pseudo-code):
>
> ctx.update(USERS).
>       set(USERS.LAST_NAME, userPojo.getLastName()).
>       if (userPojo.getFirstName() != null) {
>         set(USERS.FIRST_NAME);
>       }
>       where(USERS.ID.eq(id)).
>       execute();
>
> which is obviously not valid code.
>
> I think maybe something along the lines of:
>
> UpdateSetMoreStep s =
>     ctx.update(USERS).
>         set(USERS.LAST_NAME, u.getLastName());
>
> if (u.getFirstName() != null) {
>   s.set(USERS.FIRST_NAME, u.getFirstName());
> }
>
> s.where(USERS.ID.eq(u.getId())).
> execute();
>
> might be slightly more idiomatic.
>

Yes, that would work. Or you could resort to the model API, which simply
operates on UpdateQuery...


>
> Thanks for all of your time, BTW.


You're welcome! :-)
Cheers,
Lukas

-- 
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