PDA

Click to See Complete Forum and Search --> : Database structure question


gxpark
Oct 2nd, 2000, 02:12 PM
Hello,

I have this little problem.

I'm developing a wrapper for a database that exposes the database structure with classes and collections. Well, it would be more correct that I need to create a database structure from the collections/classes struct.

The problem is that I don't know how to store a collection tree on the database.

For example, I have these classes:

* Employees - Collection of employees
* Employee - An employee
* Addresses - Addresses where the employee can be contacted (actually this is inherited from an interface called IContact).
* Address - An address

So, I create a table named Employees, that will hold an employee info with each record. But, how do I store the Addresses collection? Do I create another table for each employee that will hold his addresses? Do I compress all the info on a single field in the first table? or what?

I'm puzzled here...

ANY help (or idea) is welcome...

JHausmann
Oct 2nd, 2000, 02:43 PM
Create another table, Addresses. Include in that table a key (made up of 2 parts), Employee (number?) and Address type (in case an employee can have more than 1 address)