Load only some columns with Hibernate native SQL queries
- by Alessandro Dionisi
I have a table on the database and I want to load only some columns from the result set. I defined a native sql query in the hbm file:
<sql-query name="query">
<return alias="r" class="RawData"/>
<![CDATA[
SELECT DESCRIPTION as {r.description}
FROM RAWD_RAWDATAS r
WHERE r.RAWDATA_ID=?
…