Hi All,
I have a native sql query which is returning few fields out of many columns in table.
I am writing that named sql query in hbm file and doing aliasing like this. I have table euivalent pojo as well. But when i am using hbm file its is not returnig employee object with specific selected fileds. When i use in java code using .setResultTransformer(Transformers.aliasToBean()).It is working
Please help a way to do in hibernate mapping file instead of java code.
<sql-query name="getStudents"> <return alias="XNI" class="com.Employee"/> <return-scalar column="name" type="string"/> <return-scalar column="className" type="string"/> select NAME,CLASS_NAME from EMPLOYEE_DETAILS </sql-query>
|