[jboss-user] [EJB 3.0] - Misunderstanding SqlResultSetMapping

kpiis do-not-reply at jboss.com
Thu May 24 12:14:51 EDT 2007


I'm trying to write nativeQuery which should returns result in 2 enitities:
A & B. There are a lot of fields  in each entity.
@SqlResultSetMapping(name="BLABLABLA",
      entities={@EntityResult(entityClass=A.class,
                              fields={@FieldResult(name="aid",
                                                   column="aid")}
                ),
                @EntityResult(entityClass=B.class,
                              fields={@FieldResult(name="bid",
                                                   column="bid")}
                                      )})
My questions are:
should I put all fields in @FieldResult anotations, if I am interested in only in primary keys of 2 entities?
If I want receive additional fields - Have I to add these fields to @FieldResult?
And now I have trouble with my native query:
Entity A have realtion with another entity C (type one2one, PK of another entity are saved in A table) and when query is executed - the Hibernate throws errors, that it cannot read the property C. What is the problem?


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

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



More information about the jboss-user mailing list