[jboss-user] [JBoss Seam] - Re: OneToMany - view
pete.muir@jboss.org
do-not-reply at jboss.com
Mon Oct 29 08:42:47 EDT 2007
"mortena" wrote : Create a new Person with a default address in one form.
| Add new addresses to an existing Person.
|
| How do I do that?
You probably want to extend the createInstance() method of PersonHome generated by seam-gen to add the default address to the person.
@Override
| protected Person createInstance() {
| Person person = new Person();
| Address address = // lookup default address
| person.getAddresses().add(address);
| return person;
| }
Though I would normally make address an embedded entity.
anonymous wrote : Can seam-gen handle relationships between entities?
Yes
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099823#4099823
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099823
More information about the jboss-user
mailing list