Hello,

> We are evaluating JOOQ as our possible data access approach.
> Unfortunately DB currently used has no PK or any other integrity
> constraints and schema cannot be changed just because developer says
> so.

Absolutely. jOOQ encourages architectures where the "database comes
first", and the client should be adapted to the database.

> Is there a way to update table record iterating over changed fields?

Unfortunately, without a UNIQUE or PRIMARY KEY, there is currently no
way of updating a org.jooq.TableRecord (non-UpdatableRecord)
automatically. On the other hand, I'm just thinking about enhancing
TableRecord, such that you can explicitly provide the informal
"PRIMARY KEY by convention", e.g.

public interface TableRecord {
    int store(Condition condition);
    int store(Field<?>... primaryKey);
}

I'll see whether this can be added for jOOQ 1.6.4:
https://sourceforge.net/apps/trac/jooq/ticket/785

> create.update(T_AUTHOR)
>      .set(TAuthorRecord)
>      .where(TAuthor.ID.equal(TAuthorRecord.ID))
>      .execute();

That's possible, of course. See the manual:
https://sourceforge.net/apps/trac/jooq/wiki/Manual/JOOQ/Query#UPDATEStatements

> Thanks for filling gap between ORM and JDBC.

You are welcome! :-)

Cheers
Lukas

Reply via email to