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

Multi Table Persistent object

Last post 11/21/2008 11:22 AM by Alain Bismark. 6 replies.
Page 1 of 1 (7 items)
Sort Posts:
Previous Next
  • 11/10/2008 3:54 PM

    Multi Table Persistent object

    Ok, I've been through all available documentation regarding this topic, it seems to me that the only way to accomplish this is by creating Views that join the different tables that a persistent object refers to, putting a INSTEAD OF trigger to handle the updates to the view.

    What I was looking for was a way to do the mappings on the client side, something like this:

    [MapTo("Table1"), t1]
    [MapTo("Table2"), t2]
    public class myClass : XPObject {
           [Persistent("name"), t1]
           public string myName;

           [Persistent("age"), t2]
           public int myAge;
    }

    Or whatever, hope is clear enough what I'm asking. Any comments will be appreciated, thank you.

     

  • 11/17/2008 11:20 AM In reply to

    Re: Multi Table Persistent object

     Can you explain more in detail your situation, to find an appropiate solution.

    Regards

  • 11/18/2008 3:04 PM In reply to

    Re: Multi Table Persistent object

    As I understand the question, how to implement the situation as described on (for example) http://www.devx.com/tips/Tip/21433 using XPO?

    regards,

    Martin

  • 11/18/2008 4:21 PM In reply to

    Re: Multi Table Persistent object

     Ok,

    Basically what I'm saying if there is a possibility to to describe a "Persistent Object" that actually encapsulates two tables at the same time. Let's say that I already have a UserIdTable and a UserContactTable, which the union of both I want it to be the "User Persistent Object". I did not find any way to accomplish this with XPO, the only way that though of is by making the UNION on a View and at the moment of updating a row may the instead of trigger write two both tables.

    Now I'm assuming this doesn't exists in XPO yet; wanted to make sure I'm not missing anything. Cause that could be a very nice feature for people like myself that have an already existant DB.

  • 11/19/2008 3:02 AM In reply to

    Re: Multi Table Persistent object

    Not sure if this is what you are looking for, but ... have you read the "How
    to: Change Inheritance Mapping " chapter on XPO help ?
    (MapInheritanceAttribute Class)

    LP
  • 11/21/2008 11:07 AM In reply to

    Re: Multi Table Persistent object

    Let me see if I get it, make two related tables in a inheritance relation in order for XPO handle the data manipulation. Is this correct?

     

  • 11/21/2008 11:22 AM In reply to

    Re: Multi Table Persistent object

    Hi.

    1. You can not map the same class to two tables applying attributes in "normal code".

    2. You can do some tricks, creating a ClassInfo to some real .NET class, and addiding properties and mapping this to a table of the database, sounds complicated but work.

    But I need more details about your real problem to help you.

     

    Regards.

     

Page 1 of 1 (7 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED