[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations

2007-08-07 Thread icordoba
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

[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations

2007-04-09 Thread kstrunk
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

[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations

2007-04-05 Thread jantzen
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

[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations

2007-04-05 Thread fhh
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

[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations

2007-04-04 Thread kstrunk
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

[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations

2007-04-04 Thread kstrunk
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

[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations

2007-04-04 Thread fhh
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

[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations

2007-04-04 Thread kstrunk
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

[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations

2007-04-03 Thread kstrunk
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

[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations

2007-04-03 Thread oskar.carlstedt
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

[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations

2007-04-03 Thread kstrunk
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 :

[jboss-user] [EJB 3.0] - Re: Entity relationship and remove operations

2007-04-03 Thread fhh
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