[jboss-user] [EJB3] - native queries with non-persisted values
daniel jarrett
do-not-reply at jboss.com
Tue Jan 4 12:39:00 EST 2011
daniel jarrett [http://community.jboss.org/people/DoubleDenim] created the discussion
"native queries with non-persisted values"
To view the discussion, visit: http://community.jboss.org/message/578781#578781
--------------------------------------------------------------
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.
Query q = em.createNativeQuery("call mydb.FindLocationsByCoords("+lat+","+lng+","+radius+")", Location.class);
List<Location> results = q.getResultList(); //from a resultset
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
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/578781#578781]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110104/b673810d/attachment.html
More information about the jboss-user
mailing list