Hello,
I really looking forward for an answer for my problem as described at
stackoverflow:
http://stackoverflow.com/questions/7986970/
I try to summarize the information:
Model
Shop
- name
- List of addresses
Address
- location
- shop (link to shop)
my form:
- hidden:
shop.id=1
- input:
shop.name=foo
- List of addresses
- hidden: shop.addresses[0].id=0
- input: shop.addresses[0].location=bar
- submit
The post parameter would look like ?
shop.id=1&
shop.name=foo&shop.addresses[0].id=0&shop.addresses[0].location=bar
The controller has just an object shop:
public form(Long id, Shop shop) {
....
shop.save()
}
The data in shop are all there and everythink looks fine, but if I try
to store the data, the error detached entity passed to persist
occurs.
I also tryed shop.merge() but the address data will not be persisted
to the database.
How can I store my data without getting this annoying error?
Every hint would be very helpful.