CodeSmith Community
Your Code. Your Way. Faster!

Composite Keys and m:mRelationships

Latest post 03-30-2008 8:38 AM by FireLin. 0 replies.
  • 03-30-2008 8:38 AM

    • FireLin
    • Not Ranked
    • Joined on 03-02-2008
    • Posts 1
    • Points 5

    Composite Keys and m:mRelationships

    My Question is as follows. what would be the best practice in database, for a webbased application, using .NetTiers as my DAL?

    Sorry If I posted in the wrong thread.

    1 - Conventions

     PrimaryKey (PK) , ForeignKey (FK),

    Employer-> Company,Organization ,

    Branch -> Company Branch,

    ContactPerson -> Recuiter or this Companies Representer

    2- Problem

    I got table Employer with EmployerId(PK)  (AutoIncremented)

    Table EmployerBranch with BranchId (PK) (AutoIncremented) & EmployerId (PK)(FK)

    Here Comes the Problem, either two cases

       Case 1

    Table Contact Person with PersonId (PK) (AutoIncremented), BranchId(PK)(FK) and EmployerId(PK)(FK)

       Case 2

    Table Contact Person with PersonId (PK) (AutoIncremented), BranchId(PK)(FK)

     which is better in data retrival in my argument that if I wanted an information on Employer and I got my ContactPerson object, I will be easy to retrive the root parent, instead of going recursivly from Contact Person to Branch to Employer.

    Second is their in better practices, and how much it would tangle using .NetTiers

    Your Rapid Reply will be very appreciated as it's due to resolve this problem for tomorrowBig Smile

    • Post Points: 5
Page 1 of 1 (1 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems