I'm not sure if this is possible in Hibernate but it would be really great if it was :) I've not actually got past the conceptual stage with this but I'll explain as best as I can.
I want to make use of Oracle Spatial features to do proximity based searching. Imagine I've got a Location entity which stores a latitude/longitude value. Then imagine I want to query for all locations within 5km of a user specified latitude/longitude location. In the results, I want to see all matching Locations but, in addition to the standard mapped fields on the Location entity, I also want to present the distance of each Location relative to the user specified location.
Oracle Spatial would let me do this as a calculated field in SQL but I don't understand how Hibernate can support calculated fields that get returned from the database. As the calculated field is not a column in the table, I can't do a standard mapping.
Is there some special features that allow me to create wrappers for POJOs and have Hibernate map to them such that additional calculated properties can be returned?