Hi there,
I haven't been able to solve this same problem (deleted entity passed to
persist exception when deleting a OneToMany with cascade all relation(). You
say you just have to refresh the parent, but you were saying that you delete
the parent and you expect the children to be deleted. If
fhh wrote : Another problem might be that your entityManager is not in sync
with the database.
You were right. I simply had to refresh the parent and then hibernate could
delete all references. So it's working now.
Conclusion: Hibernate does the cascading delete itself and does not use
I'm facing a similar problem with child entities not being deleted with their
parents. The exception I see is javax.persistence.EntityNotFoundException:
deleted entity passed to persist, and it looks like the entity manager is
trying to persist the child entities with null references to the
When I said the entity manager deletes the children manually I did not mean to
say that _you_ as developer have to do it. What I meant to say is that instead
of using on delete cascade on the constraint the entity manager might send a
delete statement for every child to the database.
Regards
fhh wrote : Have you looked up which entity the error message refers to and
to which constraint?
|
| Another problem might be that your entityManager is not in sync with the
database.
|
|
| Regards
|
| Felix
Hi Felix,
the error message refers to member sender of entity
Hi!
I've just altered the table to enable cascading:
| CONSTRAINT fk278c74e4b6f3dc65 FOREIGN KEY (sender)
| REFERENCES users (id) MATCH SIMPLE
| ON UPDATE NO ACTION ON DELETE CASCADE,
|
And now deleting users works fine, but why is the schema not created
automatically
anonymous wrote :
| And now deleting users works fine, but why is the schema not created
automatically this way?
|
I'm not sure whether javax persitence uses the on delete cascade functionality
of the underlying database or whether the entitymanager will manually delete
ferenced
fhh wrote : anonymous wrote :
| | And now deleting users works fine, but why is the schema not created
automatically this way?
| |
|
| I'm not sure whether javax persitence uses the on delete cascade
functionality of the underlying database or whether the entitymanager will
Nobody an idea?
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4033908#4033908
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4033908
___
jboss-user mailing list
Hi!!
I'm not sure about this. But I think I've read that you cannot specify booth
name and referenceColumn when using the JoinColumn annotation.
Try to just use the name attribute.
//Oskar
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4034042#4034042
Thanks for your reply.
I tried it out. I removed the name and/or the referencedColumn, but it didn't
work.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4034270#4034270
Reply to the post :
Have you looked up which entity the error message refers to and to which
constraint?
Another problem might be that your entityManager is not in sync with the
database.
Regards
Felix
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4034341#4034341
Reply to
12 matches
Mail list logo