This content has been marked as final.
Show 2 replies
-
1. Re: OneToMany - view
pmuir Oct 29, 2007 8:42 AM (in response to mortena)"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.Can seam-gen handle relationships between entities?
Yes -
2. Re: OneToMany - view
mortena Oct 30, 2007 4:45 AM (in response to mortena)One Person can have many addresses.
Morten