in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Using XPO for an existing database with composite primary keys

Last post 6/13/2007 12:28 PM by Surya Katakam. 1 replies.
Page 1 of 1 (2 items)
Sort Posts:
Previous Next
  • 6/9/2007 2:02 PM

    Using XPO for an existing database with composite primary keys

    We are evaluating XPO to use in migrating our existing multi-tier win32 application to .NET.   

    Is it possible to use XPO with an existing database with composite primary keys?  Our database has a table structure as follows:

    SalesDocuments

    DocumentType: integer (Primary Key)

    DocumentNumber: integer (Primary Key)

    CustomerCode: string

    DocumentDate: datetime

    Amount: decimal

    LineItems

    DocumentType: integer  (Primary Key)

    DocumentNumber: integer (Primary Key)

    Sequence: integer (Primary Key)

    ItemCode: string

    Qty: decimal

    Can someone suggest how to define the mapping schema and XPObject definitions for the above structure?

    Thanks and Regards,

    Surya

    Filed under:
  • 6/13/2007 12:28 PM In reply to

    Re: Using XPO for an existing database with composite primary keys

    Answer
    Here is what I learned from somebody: XPO supports compound primary keys (http://www.devexpress.com/kb2615), but it's impossible to define an association between two objects by a part of a compound key (http://www.devexpress.com/issue=CQ36113). There are two solutions in this case: 1. Develop your new application with XPO and transfer data from your old database to a new one. 2. Don't use associations between objects with compound keys.
    Filed under:
Page 1 of 1 (2 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED