[hibernate-dev] metamodel branch and identifier handling

Steve Ebersole steve at hibernate.org
Wed Apr 18 10:06:20 EDT 2012


This is pretty much done.  The only identifier-related piece to do 
still is support for @MapsId.

Part of this process was introducing the notion of synthetic 
attributes, which are attributes which don't really exist in the domain 
classes.  HIbernate uses them for a number of things.  Here, it was 
needed for handling "non-aggregated composite identifiers" (composite 
ids that are not represented by a @EmbeddedId).  The important take 
away is that in the metamodel now identifiers ALWAYS are represented as 
a single attribute.  In the case of 
org.hibernate.id.EntityIdentifierNature#SIMPLE and 
org.hibernate.id.EntityIdentifierNature#AGGREGATED_COMPOSITE that 
single attribute is a real attribute; in the case of 
org.hibernate.id.EntityIdentifierNature#COMPOSITE the attribute is 
synthetic.

On Wed 11 Apr 2012 04:03:22 PM CDT, Steve Ebersole wrote:
> The main pieces of identifier handling are in place now on the
> metamodel branch. Probably still needs some work in terms of building
> persisters, etc but what doesn't on that branch ;)
>
> Anyway, one thing in particular I was hoping to get a discussion on is
> the org.hibernate.metamodel.spi.binding.EntityIdentifier class. The
> javadocs kind of tell the story, but basically it represents a dual
> contract (single versus multiple attribute identifiers).
>
> If anyone has time to take a look and give feedback that would be great!
>

--
steve at hibernate.org
http://hibernate.org


More information about the hibernate-dev mailing list