Hi,

I've a database with 2 tables, school and classroom. When i delete a school,
i want to delete all the corresponding classroom. But when i delete a
classroom, i want to keep my school.

In my classroom.java, i've declare an attribute like this:

    @ManyToOne(cascade=CascadeType.ALL, optional=false)
    @JoinColumn(name="SCHOOL_ID", nullable=false)
    public Site getSchool () {
            return school;
    }
    public void setSchool(School s) {
            this.school = s;
    } 

If i look in my Database, the table is create correctly. But when i run my
test, it tells me that he cannot delete or update a parent row. I've seen a
lot of post about problems who looks similar, but i haven't found any
solution. Did you have any idea?


-- 
View this message in context: 
http://www.nabble.com/Problem-%3A-Many-to-One%2C-cannot-delete-or-update-a-parent-row-tf3446618s2369.html#a9611762
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to