[hibernate-dev] Naming and "naming strategies"

Hardy Ferentschik hardy at hibernate.org
Mon Feb 2 14:15:31 EST 2015


> > Also, you might think about embedded objects. I think today the implicit
> > contract received the qualified property names separated by dots
> > e.g. “homeAddress.street”. should that continue as it is or is there a need
> > for abstraction?
> >
> This is already handled well IMO.  The naming strategy is handed an
> AttributePath, which is a "composite name" object.  E.g.
> "homeAddress.street" is defined as:
> new AttriubutePath().append( "homeAddress" ).append( "street" );
> For completeness, there is also a paired AttributeRole for each
> AttributePath which has the same "path", but which includes the base:
> new AttributeRole( "com.acme."Company" ).append( "homeAddress" ).append(
> "street" );

I like this. The dot notation and the required splitting of string is 
a very fiddly thing in the current code (and error prone). Switching to
a typed path is definitely a good idea.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 496 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/hibernate-dev/attachments/20150202/faa9bfb0/attachment.bin 

More information about the hibernate-dev mailing list