On Mon 2013-06-10 9:45, Gunnar Morling wrote:
2013/6/7 Emmanuel Bernard <emmanuel(a)hibernate.org>
> Note that the domain model could have use inheritance or composition to
> naturally enforce the presence or not of attributes depending on the
> model / role. It probably would be cleaner but is not always possible on
> existing domain models.
>
Yes, although I think even for newly created models it doesn't always make
sense to differentiate roles of an entity via sub-classing/delegation, e.g.
when the roles are dynamically retrieved from a database or similar.
Even from the database, you can map it as subclasses or delegation. I've
spent enough time in the ORM space to know that's actually a natural way
to do it ;)