Jooq: The JPA Column annotation should not be mandatory

Created on 28 Sep 2015  路  5Comments  路  Source: jOOQ/jOOQ

Currently, jOOQ's DefaultRecordMapper either applies mapping by convention _OR_ via JPA @Column annotations. But in JPA, the @Column annotation is not mandatory on entities. If absent, default behaviour applies. jOOQ should also implement this behaviour.


See also:

Functionality C JavaEE All Editions Medium Enhancement Incompatible change

Most helpful comment

Can you please create a separate issue?

Done.

All 5 comments

Related to this, entity fields which are marked with @Column but do not have the name defined on the annotation are ignored. Not sure if this is intended behavior or not.

Current code (Tools.getAnnotatedMembers) has

if (namesMatch(name, column.name())) { // if the column annotation name field matches the reflected field name
    result.add(accessible(member));
}

Thanks for the feedback, @kag0. This is not the intended behaviour. Even if jOOQ doesn't really implement JPA, it should adhere to the JPA spec where JPA annotations are interpreted.

Further, the DefaultRecordMapper should probably skip any members annotated with JPA's @Transient annotation.

Further, the DefaultRecordMapper should probably skip any members annotated with JPA's @Transient annotation.

Can you please create a separate issue?

Can you please create a separate issue?

Done.

Was this page helpful?
0 / 5 - 0 ratings