Hi,
I have a sql statement joining over various tables. For performance reasons (~100000 results) I want to fill the direct result into a Pojo, without referencing any other tables / Pojos. If possible, I would like to go without HQL. The simplified statement looks like that: select e.name, d.depName from employee e join deparment d on (e.depNo = d.depNo). The simplied Pojo looks like this:
MyPojo - employeeName - deparmentName
How can I fill results of several joined tables into the same Pojo? Currently I am using <return-scalar column="name" type="string"/> <return-scalar column="depName" type="string"/>
To improve performance I want to use a ScrollableResult, which again I want to encapsulate into a Iterable, so that I can easily iterate over its elements. However this will only work on a pojo not on a set of single values.
1. Any idea how I could get this done? 2. Some of the returned rows are dates, which I would like to directly convert to JodaTime, if possible. I found stuff like: <typedef class="org.joda.time.contrib.hibernate.PersistentDateTime" name="dateTime"/> <property name="myDate" type="dateTime"> <column name="MY_DATE" not-null="false" /> </property> but this didn't work out either :-(
Any help would be greatly appreciated, thanks!
Peter
|