cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: Two DataMaps/DataNodes with the same entity/class name
Date Tue, 16 Jun 2009 12:22:38 GMT
Hi Borut, you may want to look at my copying DataMaps example:

http://cwiki.apache.org/CAY/copying-datamaps.html

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.

mrg



On Tue, Jun 16, 2009 at 6:03 AM, Borut BolĨina<borut.bolcina@gmail.com> 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
>

Mime
View raw message