Re: Two DataMaps/DataNodes with the same entity/class name

From: Michael Gentry (
Date: Tue Jun 16 2009 - 08:22:38 EDT

  • Next message: Marco Gattei: "Upgrading from cayenne 2.0.4 to cayenne 3.0.M5/M6"

    Hi Borut, you may want to look at my copying DataMaps example:

    It is old (still references "objectstyle" instead of "apache", but
    might work fine with minor changes (like changing the package name).
    (I haven't tried it on Cayenne 2.x+ yet.)

    I was able to use the same classes across different
    DataDomains/DataNodes even within the same running application using
    this technique. (I had 7 active database connections to development
    (x2), testing (x2), acceptance (x2), and production (x1) databases for
    a support program to examine application data internals.) The trick
    is to create your DataContext passing it the correct
    DataDomain/DataNode to use and then all is well. Cayenne handled
    everything very smoothly after that -- everything went to the proper
    database connection since the DataContext (which was created with the
    DataDomain/DataNode to use) does all the queries and the commits.


    On Tue, Jun 16, 2009 at 6:03 AM, Borut Bolina<> wrote:
    > Hi,
    > is it somehow possible to have two DomainNodes (2 different independent
    > databases) with the same entity/class name? Both databases have table
    > (entity) "user" and I don't want to rename one class to UserSomething.
    > Regards,
    > Borut

    This archive was generated by hypermail 2.0.0 : Tue Jun 16 2009 - 08:23:13 EDT