[jboss-user] [EJB 3.0] - Cast an SqlResultSetMapping class

graflaszlo do-not-reply at jboss.com
Mon Feb 12 12:49:36 EST 2007


Hi all,

I have an SqlResultSetMapping like this one:


  | @SqlResultSetMapping(
  | name="getData01",
  | entities={@EntityResult(entityClass=Klass01.class,
  |                     fields={@FieldResult(name="id", column="id"),
  |                                 @FieldResult(name="datum", column="datum")
  | 	              }),
  |               @EntityResult(entityClass=Klass02.class,
  |                     fields={@FieldResult(name="col1", column="col1"),
  |                                 @FieldResult(name="col2", column="col2")
  | 	              })
  | 	         }
  | )
  | 

and I use it in this Query:


  | Query q01 = createNativeQuery(queryString, "getData01");
  | 

where queryString looks like this:


  | select klass01.id, klass01.datum, 
  |        klass02.col1, klass02.col2 
  |   from klass01,
  |        klass02
  |  where klass01.id = klass02.col1
  | 

Until now OK, it works fine.
OK, I have the List with the results, but how can I
access the id, datum, col1 and col2 fields?

What is the class that I have to use to cast the base
object of the List?

Please help me, thank you.
Laci


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4015242#4015242

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4015242



More information about the jboss-user mailing list