Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Re sultType for List

The JPA spec requires Object[] to be returned for any query that returns
multiple select values.

Not that a List will be returned for multiple rows, only an Object[] for
multiple select values (i.e. "Select id, name from foo" gives
List<Object[]>).

Returning Vector for this in TopLink Essentials was a bug, and I believe
also fixed in TopLink Essentials.  There is not way to configure EclipseLink
to return a Vector for multiple select values.

Note that if you only select one value, just the value is returned, no
Object[].


Sessizlik wrote:
> 
> Hi,
> 
> I have a legacy project which is implemented at toplink and will be
> upgraded to Glassfish 3.1.1. That is to say the most dramatic change will
> be at persistence layer which will be upgraded to Eclipselink 2.x . 
> 
> However I have a little challenge. Before going further more and changing
> codes I have searched eclipselink default behaviour for the
> "createNativeQuery" and came across that it is returning array as a
> default behaviour which is vector at toplink.
> 
> 1) How can I return vector instead of Array? [1]
> 
> 2) How can I globally set hint for queries?
> 
> 3) Is there any performance problem because of changing default behaviour?
> 
> Thanks
> 
> [1]
> http://www.eclipse.org/eclipselink/api/2.2/org/eclipse/persistence/config/ResultType.html
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
Blog:  http://java-persistence-performance.blogspot.com/ Java Persistence
Performance 
-- 
View this message in context: http://old.nabble.com/ResultType-for-List-tp32363335p32380126.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top