Hi,
I'm just getting started with jOOQ, and just wanted to check whether I'm
taking the right approach.
I've successfully read in my own sample MSSQLServer database, primary keys
have been detected and UpdatableRecord classes generated.
I'm attempting to read a row, set a field value and store it back. I want
to be able to use the generated getters and setters rather than getValue,
so I'm fetching into the generated class like so:
return factory.select()
.from(USERS)
.where(USERS.EMAILADDRESS.equalIgnoreCase(emailAddress))
.fetch().into(USERS);
when I call store() on the result, jOOQ is trying an INSERT instead of an
UPDATE. After doing some debugging I've worked out that into() is calling
setValue() on the primary key field which marks it as changed, hence the
INSERT.
Should I be taking a different approach here? Or is there a way I can reset
the "changed" property on the PK field in order to produce an UPDATE
instead of the INSERT?
Any advice appreciated. Looks like a great library so far!
Cheers,
James