JBoss Community

native queries with non-persisted values

created by daniel jarrett in EJB3 - View the full discussion

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

Start a new discussion in EJB3 at Community