Cascading of delete is not supported in the JPA spec, so you will need to
use the @OnDelete Hibernate extension to do it: http://tinyurl.com/22n4wv
Mike
On 9/19/07, phamvubinh <[EMAIL PROTECTED]> wrote:
>
>
> I have the same error. Any suggestion for this mistake?
> Donleyp, have you found the solution?
>
> Thanks
> Binh Pham
>
>
>
> donleyp wrote:
> >
> > I am getting the following error when I try to delete a user:
> > "java.sql.SQLException: ORA-02292: integrity constraint
> > (FTAP_DEMO.FK1D0C220DF503D155) violated - child record found"
> >
> > I looked at the DDL generated by hibernate and it does not contain the
> > cascade delete clause in the alter table statement for this foreign key.
> I
> > am trying to figure out if it is possible to get that clause added.
> >
> > I have a domain object that associates itself with a user (represented
> by
> > org.appfuse.model.User). Here are the setter and getter for it:
> > /**
> > * @return the user
> > */
> > @ManyToOne(cascade = CascadeType.ALL, optional = false)
> > public User getUser()
> > {
> > return user;
> > }
> >
> > /**
> > * @param user
> > * the user to set
> > */
> > public void setUser(User user) {
> > this.user = user;
> > }
> >
> > From my reading of the persistence spec, that "cascade=CascadeType.ALL"
> is
> > only really for operations originating on the this object, so it is not
> > doing me any good. I need a way to tell hibernate that it should cascade
> > deletes from user to this object. Any suggestions?
> >
> > Thanks!
> >
> > Donley
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Cascading-delete-from-User-to-my-own-model-objects.-tf3854160s2369.html#a12770256
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>