-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping problem
PostPosted: Fri Mar 11, 2011 6:14 am 
Newbie

Joined: Wed Jan 16, 2008 6:25 pm
Posts: 4
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.