CodeSmith Community
Your Code. Your Way. Faster!

best practice for an entity mapping two database tables

Latest post 06-13-2007 2:50 PM by Don. 1 replies.
  • 06-13-2007 8:44 AM

    • blob
    • Not Ranked
    • Joined on 07-11-2006
    • Posts 2
    • Points 70

    best practice for an entity mapping two database tables

    We have a legacy database we cannot change the database schema because many systems run on it. the database designer divided a business entity persist into two database tables. for example, Product table is (ProductId, Name, ...), ProductPhoto table is (ProductId, Photo), product's photo field is stored in another table(ProductPhoto table), both ProductId is primary key. NetTiers will generate two entity classes, two datasource classes according database two tables. but in my admin UI aspx page we hope the Photo field can be 'CRUD' with the other fields of  Product seamless. what's the best practise to do that?

    • Post Points: 35
  • 06-13-2007 2:50 PM In reply to

    • Don
    • Top 100 Contributor
    • Joined on 11-03-2006
    • Posts 48
    • Points 1,000

    Re: best practice for an entity mapping two database tables

     You could setup a view and allow .netTiers to generate an entity object for the combined view.  This gives you only read-only access to the data though.  But, you can always take the data from the CRUD screen and populate the necessary entities for updates or deletes.

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