[jboss-user] [JBoss Seam] - Re: OneToMany does not load
MikeDougherty
do-not-reply at jboss.com
Mon Feb 19 19:47:04 EST 2007
Thanks for the reply petemuir. I sort of expected it to be a Hibernate issue. But I am unclear as to where Seam leaves off and Hibernate takes over, so I figured I'd start here.
The "show sql" Hibernate option is on in seam-gen projects by defaut, but I need to look at the SQL a little closer next time. After looking though the SQL, I realized that
| @OneToMany(cascade=ALL, mappedBy="id", fetch=EAGER)
| public List<Store> getStores() {
| return stores;
| }
|
Should have actually been...
| @OneToMany(cascade=ALL, mappedBy="district", fetch=EAGER)
| public List<Store> getStores() {
| return stores;
| }
|
The "mappedBy" attribute should point to the property in the Store object which will contain the mapped District object.
Anyway, thanks again for the response.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019101#4019101
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019101
More information about the jboss-user
mailing list