| Although this issue persists, this is my workaround that allows SQL queries to return a limited subset of data fields. Simply put, it requires adding a separate hibernate class definition for each unique set of query result fields, but does NOT require separate Java classes to be defined. Steps: 1. Define a separate hibernate class mapping against the original Java class, listing only those fields that are returned from the limited query. Value the "entity-name" attribute with a unique pseudonym. 2. When defining the "sql-query", refer to the pseudonym from the "return" element, rather than using the original class name. 3. Map those fields normally (e.g. via return-property or as {}), only listing those fields in the pseudonym class Example hibernate mapping: <class name="com.test.MyClass" entity-name="com.test.MyClassPseudonym">...</class> <sql-query name="MyQuery"><return alias="mc" class="com.test.MyClassPseudonym">/>...</sql-query> |