[jboss-user] [EJB 3.0] - Re: Query returns Object instead of the right type....
hanyshafik
do-not-reply at jboss.com
Thu Mar 12 02:18:54 EDT 2009
The following query
SELECT taskId, taskName FROM TaskList AS a
doesn't return list of tasks instead it will return list of objects, each item in the list describes one row as another list of objects. Each item in the latter list describes one column (e.g. taskName as String).
if you want it to return list of tasks that has only taskid and taskname populated you can you use the following query
SELECT new TaskList(taskId, taskName) FROM TaskList AS a
ofcourse you will need the above constructor for TaskList
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217278#4217278
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217278
More information about the jboss-user
mailing list