users@glassfish.java.net

Re: what datatype can em.createQuery().getResultList return?

From: <glassfish_at_javadesktop.org>
Date: Fri, 13 Jun 2008 10:18:32 PDT

Well, I'm not sure what to tell you. When I run a query like:
[code]
SELECT x FROM X x
[/code]
...I get back a List of X objects.

When I run a query like:
[code]
SELECT x.iD, x.displayName FROM X x
[/code]
...I get back a List of Object[] objects. Or, at least when I do:
[code]
final boolean arrayOrNot = resultList.get(0) instanceof Object[];
[/code]
...then arrayOrNot's value is true.

Does that help?

Best,
Laird
[Message sent by forum member 'ljnelson' (ljnelson)]

http://forums.java.net/jive/thread.jspa?messageID=280230