Hi guys,
I've just committed the basic support for alias-mode which allows you to be very lazy regarding usage of native-sql queries.
Before you had to do this: <sql-query name="employment"> <return alias="emp" class="Employment"/> SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer}, STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate}, REGIONCODE as {emp.regionCode}, EMPID AS {emp.id} FROM EMPLOYMENT WHERE EMPID = ? </sql-query>
Now you can do: <sql-query name="employment"> <return alias="emp" class="Employment" alias-mode="mapped"/> SELECT * FROM EMPLOYMENT WHERE EMPID = ?
</sql-query>
I don't know if AliasMode is the right word for this, maybe UserAliasMode is better ?
Comments welcome.
TODO:
- remove need for specifying alias (only needed if you actually use the {} syntax
- add AliasMode and general property-return support for collection loading
/max
------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel