Another discrepancy between hbm.xml and annotations currently is the 
definition of natural ids.  hbm.xml only allows natural ids to be 
defined on the root entity, annotations allow it to be defined on any 
level of the hierarchy, even across classes.

We need to decide what we want to support.  2 things to consider here are:
1) whether we limit @NaturalId to only root entity meta (and maybe 
@MappedSuperclass for root entities)
2) if we do not limit, what @NaturalId spread across a hierarchy "means"

In the second point, consider:
class A
     @NaturalId
     key1

class AA extends A
     @NaturalId
     key2

Personally I vote for limiting @NaturalId to the root entity.  This 
allows caching to work just like it does for identifiers.

-- 
st...@hibernate.org
http://hibernate.org

_______________________________________________
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Reply via email to