Results 1 to 2 of 2

Thread: Database structure question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Mexico City
    Posts
    242

    Lightbulb

    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...

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width