mapping tables in database with repective table class
Posted: Fri Sep 19, 2008 5:04 am
I need to create a class for each of the tables of the database. But i am having a problem to map the foreign key column.
Take for instance, table employee with eid,ename and deptno as attributes.
and table department with deptno,dname and location
class Employee {
private eid;
private ename;
private deptno;
//functions...
}
class Department {
private deptno;
private dname;
private location;
//functions...
}
Now how to build relationship between deptno in these two class.
i need to use these two class to find out the employee name when location is given.
Take for instance, table employee with eid,ename and deptno as attributes.
and table department with deptno,dname and location
class Employee {
private eid;
private ename;
private deptno;
//functions...
}
class Department {
private deptno;
private dname;
private location;
//functions...
}
Now how to build relationship between deptno in these two class.
i need to use these two class to find out the employee name when location is given.