Correct me if I'm wrong, but currently, the Criteria API requires an alias or a subcriteria on an association in order to access an association's properties.
So, given Person.class p, in order to access p.address.countryName as a projectionlist property address.countryName, it would be necessary to createAlias(address, "address") or createCriteria(Address.class, "address").
The typical use case is user-configured columns, where it's desirable to avoid mapping associations that aren't needed for the selected columns.
HQL doesn't require this, seems like several people have asked about it, didn't notice anything in the JIRA about it...is this feature a possibility? Is there a better way of doing it?
|