-
1. Re: EJB3 Persistence to HashMap
clebert.suconic Nov 1, 2006 3:05 PM (in response to javaluva)Take a look at ejb3_0-pdf-spec-persistence.pdf, section 9.1.25...
You could use MapKey annotation for that. -
2. Re: EJB3 Persistence to HashMap
javaluva Nov 3, 2006 3:53 AM (in response to javaluva)Thanks for the reply, but I do not know if this is going to help me too much, I might be wrong, I am fairly new to JPA.
Let me clarify a bit. My ResultSet from a Callable Statement returns an unknown number of fields, which I cannot specify at design time to map to fields of a POJO.
The only alternative I can see, is if somehow the ResultSetMetaData for this ResultSet can be used by the ejb Query if have executed to map all fields to various keys of a Map with a List of values for the specific column or a single Object per key if there is only 1 row.
Is this at all possible?
Any help always appreciated. -
3. Re: EJB3 Persistence to HashMap
maxandersen Nov 3, 2006 4:36 AM (in response to javaluva)you should be able to just execute the native sql and you would get an Object[] back.
If you can use the hibernate api you can look at ResultTransformer API