ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Seth Green <seth.m.gr...@gmail.com>
Subject Updating/Deleteing Objects With One-To-Many Relationships
Date Tue, 24 Feb 2009 18:17:51 GMT
I've spent a fair amount of time reading documentation and googling,  
and while I have found information on selecting objects with one-to- 
many relationships, I have yet to find anything on updating and  
deleting.

So, if I have

class Person {
	int id;
	String name;
	List<Car> cars;
}

class Person {
	int id;
	String name;
}

And I have 3 tables

person (
	id,
	name
)

car (
	id,
	name
)

person_x_car (
	person_id
	car_id
)

How is it that I go about

1) Updating a Person who has changes to their cars
2) Deleting a Person and subsequently deleting the relevant rows in  
person_x_car

Thanks

Mime
View raw message