-->
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: native queries with non-persisted values
PostPosted: Wed Jan 05, 2011 3:37 pm 
Newbie

Joined: Wed Jan 05, 2011 3:31 pm
Posts: 1
Note: this has been pasted from the jboss ejb3 forum on the suggestion of another member.

Hi There,

I am using the following to pull back a list of results and I am pushing the results into my Location class. This all works perfectly.




Code:
Query q = em.createNativeQuery("call mydb.FindLocationsByCoords("+lat+","+lng+","+radius+")", Location.class);


List<Location> results = q.getResultList();




Now I would like to add a property to the Location class for a value which isn't persisted but is returned by my stored proc. This value is "distance", and it represents a calculation in km's that the Location record is from the coordinates entered.

Can anyone please point me in the right direction as to how I might go about this?

Thanks
DD


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.