You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by CRCVY <vi...@gmail.com> on 2010/02/01 06:04:55 UTC

How to store composite object

Hi,

Can we store the composite objects using iBATIS.

e.g. consider the following tables.

employee (emp_id, name, department_id)
department(department_id, name, location)
project(project_id, name, client_name)
employee_project(emp_id, project_id)

One employee will belong to one and only one department and he/she can work
on multiple projects.

So, Employee been will be composed of employee information, department and
projects (assume each table has corresponding bean object).

e.g.

public class Employee {

Long emp_id;
String name;
Long department_id;

Department department;
List<Project> projects;

getters and seters here.....
}

My question is how can we save this composite object.

>From iBATIS documentation i understood how to map these objects. In single
query (using joins), we can retrieve this information. But can we do the
same while storing.

-- 
View this message in context: http://old.nabble.com/How-to-store-composite-object-tp27399760p27399760.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org