[hibernate-dev] Default access type and MappedSuperclass

Guillaume Smet guillaume.smet at gmail.com
Thu Jan 10 01:14:08 EST 2019


Hi,

We recently had this issue opened about us not choosing the right access
type for a mapped super class:
https://hibernate.atlassian.net/browse/HHH-12938 .

Hibernate currently base the access type decision on the sole placement of
the @Id annotation, which, in the case of a @MappedSuperclass might not be
defined (this is the OP's case).

I closed the issue explaining what we do and pointing a workaround but the
OP rightfully replied with the JPA spec saying "The default access type of
an entity hierarchy is determined by the placement of mapping annotations
on the attributes of the entity classes and mapped superclasses of the
entity hierarchy that do not explicitly specify an access type".

I'm wondering if we should also consider the @Column annotations placement
if there is no @Id annotation.

If the answer is that it's already fixed in 6, it's all good for me :).

Thoughts?

-- 
Guillaume


More information about the hibernate-dev mailing list