You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Bryan Lewis <jb...@gmail.com> on 2012/05/17 14:06:12 UTC

multiple database querying

We need to fetch objects from a second database.  (That is, query an entity
in a second domain.)  I've tried a couple of quick things -- putting two
domains in one cayenne.xml project -- but I've been unable to make it work,
in Cayenne 3.0.2 anyway.

I found CAY-1318 which says, "Multi-datadomain runtime configurations offer
no advantage over multiple configurations with a single domain each.  So
going to change the project structure to only support a single
DataDomain."  It says it was fixed in 3.1.

So if we upgrade to 3.1 will we have an easier time?  Are there any
examples of querying from multiple configurations?

Thanks,
Bryan Lewis

Re: multiple database querying

Posted by Andrus Adamchik <an...@objectstyle.org>.
I just merged that to CAY-1152, which is a similar issue.

Andrus


On May 17, 2012, at 9:52 PM, Bryan Lewis wrote:

> Right you are.  CAY-1707.
> 
> 
> On Thu, May 17, 2012 at 2:21 PM, John Huss <jo...@gmail.com> wrote:
> 
>> You should file a bug report on the JIRA.
>> 
>> On Thu, May 17, 2012 at 1:01 PM, Bryan Lewis <jb...@gmail.com>
>> wrote:
>> 
>>> Really?  When I try to set the same name for both DBEntities, the modeler
>>> turns the name field red and shows a tooltip message "There is another
>>> entity with the name...".
>>> 
>>> Oh, it must be only a modeler quirk.  If I change the name by editing the
>>> DataMap file directly, it works.  And I can load the DataMap in the
>> modeler
>>> afterward.  Thanks again.
>>> 
>>> 
>>> On Thu, May 17, 2012 at 1:38 PM, Michael Gentry <mgentry@masslight.net
>>>> wrote:
>>> 
>>>> I thought the table names could be duplicated as long as the class
>>>> names were unique?
>>>> 
>>>> 
>>>> On Thu, May 17, 2012 at 1:18 PM, Bryan Lewis <jb...@gmail.com>
>>>> wrote:
>>>>> Rockin'!  Works like a charm.  The only drawback was that the table
>>> name
>>>> in
>>>>> the second database needs to be unique, but I can work around that by
>>>>> renaming the conflicting table on my side.
>>>>> 
>>>>> Thanks!
>>>>> 
>>>>> 
>>>>> On Thu, May 17, 2012 at 9:31 AM, Michael Gentry <
>> mgentry@masslight.net
>>>>> wrote:
>>>>> 
>>>>>> Hi Bryan,
>>>>>> 
>>>>>> I'm not sure you need two DataDomains.  Have you tried:
>>>>>> 
>>>>>> DataDomain
>>>>>> DataMapForDB1
>>>>>> DataNodeForDB1
>>>>>> DataMapForDB2
>>>>>> DataNodeForDB2
>>>>>> 
>>>>>> Then make sure that the DataNode for DataMapForDB1 is DataNodeForDB1
>>>>>> and the DataNode for DataMapForDB2 is DataNodeForDB2.
>>>>>> 
>>>>>> mrg
>>>>>> 
>>>>>> 
>>>>>> On Thu, May 17, 2012 at 8:06 AM, Bryan Lewis <jbryanlewis@gmail.com
>>> 
>>>>>> wrote:
>>>>>>> We need to fetch objects from a second database.  (That is, query
>> an
>>>>>> entity
>>>>>>> in a second domain.)  I've tried a couple of quick things --
>> putting
>>>> two
>>>>>>> domains in one cayenne.xml project -- but I've been unable to make
>>> it
>>>>>> work,
>>>>>>> in Cayenne 3.0.2 anyway.
>>>>>>> 
>>>>>>> I found CAY-1318 which says, "Multi-datadomain runtime
>>> configurations
>>>>>> offer
>>>>>>> no advantage over multiple configurations with a single domain
>> each.
>>>> So
>>>>>>> going to change the project structure to only support a single
>>>>>>> DataDomain."  It says it was fixed in 3.1.
>>>>>>> 
>>>>>>> So if we upgrade to 3.1 will we have an easier time?  Are there
>> any
>>>>>>> examples of querying from multiple configurations?
>>>>>>> 
>>>>>>> Thanks,
>>>>>>> Bryan Lewis
>>>>>> 
>>>> 
>>> 
>> 


Re: multiple database querying

Posted by Bryan Lewis <jb...@gmail.com>.
Right you are.  CAY-1707.


On Thu, May 17, 2012 at 2:21 PM, John Huss <jo...@gmail.com> wrote:

> You should file a bug report on the JIRA.
>
> On Thu, May 17, 2012 at 1:01 PM, Bryan Lewis <jb...@gmail.com>
> wrote:
>
> > Really?  When I try to set the same name for both DBEntities, the modeler
> > turns the name field red and shows a tooltip message "There is another
> > entity with the name...".
> >
> > Oh, it must be only a modeler quirk.  If I change the name by editing the
> > DataMap file directly, it works.  And I can load the DataMap in the
> modeler
> > afterward.  Thanks again.
> >
> >
> > On Thu, May 17, 2012 at 1:38 PM, Michael Gentry <mgentry@masslight.net
> > >wrote:
> >
> > > I thought the table names could be duplicated as long as the class
> > > names were unique?
> > >
> > >
> > > On Thu, May 17, 2012 at 1:18 PM, Bryan Lewis <jb...@gmail.com>
> > > wrote:
> > > > Rockin'!  Works like a charm.  The only drawback was that the table
> > name
> > > in
> > > > the second database needs to be unique, but I can work around that by
> > > > renaming the conflicting table on my side.
> > > >
> > > > Thanks!
> > > >
> > > >
> > > > On Thu, May 17, 2012 at 9:31 AM, Michael Gentry <
> mgentry@masslight.net
> > > >wrote:
> > > >
> > > >> Hi Bryan,
> > > >>
> > > >> I'm not sure you need two DataDomains.  Have you tried:
> > > >>
> > > >> DataDomain
> > > >>  DataMapForDB1
> > > >>  DataNodeForDB1
> > > >>  DataMapForDB2
> > > >>  DataNodeForDB2
> > > >>
> > > >> Then make sure that the DataNode for DataMapForDB1 is DataNodeForDB1
> > > >> and the DataNode for DataMapForDB2 is DataNodeForDB2.
> > > >>
> > > >> mrg
> > > >>
> > > >>
> > > >> On Thu, May 17, 2012 at 8:06 AM, Bryan Lewis <jbryanlewis@gmail.com
> >
> > > >> wrote:
> > > >> > We need to fetch objects from a second database.  (That is, query
> an
> > > >> entity
> > > >> > in a second domain.)  I've tried a couple of quick things --
> putting
> > > two
> > > >> > domains in one cayenne.xml project -- but I've been unable to make
> > it
> > > >> work,
> > > >> > in Cayenne 3.0.2 anyway.
> > > >> >
> > > >> > I found CAY-1318 which says, "Multi-datadomain runtime
> > configurations
> > > >> offer
> > > >> > no advantage over multiple configurations with a single domain
> each.
> > >  So
> > > >> > going to change the project structure to only support a single
> > > >> > DataDomain."  It says it was fixed in 3.1.
> > > >> >
> > > >> > So if we upgrade to 3.1 will we have an easier time?  Are there
> any
> > > >> > examples of querying from multiple configurations?
> > > >> >
> > > >> > Thanks,
> > > >> > Bryan Lewis
> > > >>
> > >
> >
>

Re: multiple database querying

Posted by John Huss <jo...@gmail.com>.
You should file a bug report on the JIRA.

On Thu, May 17, 2012 at 1:01 PM, Bryan Lewis <jb...@gmail.com> wrote:

> Really?  When I try to set the same name for both DBEntities, the modeler
> turns the name field red and shows a tooltip message "There is another
> entity with the name...".
>
> Oh, it must be only a modeler quirk.  If I change the name by editing the
> DataMap file directly, it works.  And I can load the DataMap in the modeler
> afterward.  Thanks again.
>
>
> On Thu, May 17, 2012 at 1:38 PM, Michael Gentry <mgentry@masslight.net
> >wrote:
>
> > I thought the table names could be duplicated as long as the class
> > names were unique?
> >
> >
> > On Thu, May 17, 2012 at 1:18 PM, Bryan Lewis <jb...@gmail.com>
> > wrote:
> > > Rockin'!  Works like a charm.  The only drawback was that the table
> name
> > in
> > > the second database needs to be unique, but I can work around that by
> > > renaming the conflicting table on my side.
> > >
> > > Thanks!
> > >
> > >
> > > On Thu, May 17, 2012 at 9:31 AM, Michael Gentry <mgentry@masslight.net
> > >wrote:
> > >
> > >> Hi Bryan,
> > >>
> > >> I'm not sure you need two DataDomains.  Have you tried:
> > >>
> > >> DataDomain
> > >>  DataMapForDB1
> > >>  DataNodeForDB1
> > >>  DataMapForDB2
> > >>  DataNodeForDB2
> > >>
> > >> Then make sure that the DataNode for DataMapForDB1 is DataNodeForDB1
> > >> and the DataNode for DataMapForDB2 is DataNodeForDB2.
> > >>
> > >> mrg
> > >>
> > >>
> > >> On Thu, May 17, 2012 at 8:06 AM, Bryan Lewis <jb...@gmail.com>
> > >> wrote:
> > >> > We need to fetch objects from a second database.  (That is, query an
> > >> entity
> > >> > in a second domain.)  I've tried a couple of quick things -- putting
> > two
> > >> > domains in one cayenne.xml project -- but I've been unable to make
> it
> > >> work,
> > >> > in Cayenne 3.0.2 anyway.
> > >> >
> > >> > I found CAY-1318 which says, "Multi-datadomain runtime
> configurations
> > >> offer
> > >> > no advantage over multiple configurations with a single domain each.
> >  So
> > >> > going to change the project structure to only support a single
> > >> > DataDomain."  It says it was fixed in 3.1.
> > >> >
> > >> > So if we upgrade to 3.1 will we have an easier time?  Are there any
> > >> > examples of querying from multiple configurations?
> > >> >
> > >> > Thanks,
> > >> > Bryan Lewis
> > >>
> >
>

Re: multiple database querying

Posted by Bryan Lewis <jb...@gmail.com>.
Really?  When I try to set the same name for both DBEntities, the modeler
turns the name field red and shows a tooltip message "There is another
entity with the name...".

Oh, it must be only a modeler quirk.  If I change the name by editing the
DataMap file directly, it works.  And I can load the DataMap in the modeler
afterward.  Thanks again.


On Thu, May 17, 2012 at 1:38 PM, Michael Gentry <mg...@masslight.net>wrote:

> I thought the table names could be duplicated as long as the class
> names were unique?
>
>
> On Thu, May 17, 2012 at 1:18 PM, Bryan Lewis <jb...@gmail.com>
> wrote:
> > Rockin'!  Works like a charm.  The only drawback was that the table name
> in
> > the second database needs to be unique, but I can work around that by
> > renaming the conflicting table on my side.
> >
> > Thanks!
> >
> >
> > On Thu, May 17, 2012 at 9:31 AM, Michael Gentry <mgentry@masslight.net
> >wrote:
> >
> >> Hi Bryan,
> >>
> >> I'm not sure you need two DataDomains.  Have you tried:
> >>
> >> DataDomain
> >>  DataMapForDB1
> >>  DataNodeForDB1
> >>  DataMapForDB2
> >>  DataNodeForDB2
> >>
> >> Then make sure that the DataNode for DataMapForDB1 is DataNodeForDB1
> >> and the DataNode for DataMapForDB2 is DataNodeForDB2.
> >>
> >> mrg
> >>
> >>
> >> On Thu, May 17, 2012 at 8:06 AM, Bryan Lewis <jb...@gmail.com>
> >> wrote:
> >> > We need to fetch objects from a second database.  (That is, query an
> >> entity
> >> > in a second domain.)  I've tried a couple of quick things -- putting
> two
> >> > domains in one cayenne.xml project -- but I've been unable to make it
> >> work,
> >> > in Cayenne 3.0.2 anyway.
> >> >
> >> > I found CAY-1318 which says, "Multi-datadomain runtime configurations
> >> offer
> >> > no advantage over multiple configurations with a single domain each.
>  So
> >> > going to change the project structure to only support a single
> >> > DataDomain."  It says it was fixed in 3.1.
> >> >
> >> > So if we upgrade to 3.1 will we have an easier time?  Are there any
> >> > examples of querying from multiple configurations?
> >> >
> >> > Thanks,
> >> > Bryan Lewis
> >>
>

Re: multiple database querying

Posted by Michael Gentry <mg...@masslight.net>.
I thought the table names could be duplicated as long as the class
names were unique?


On Thu, May 17, 2012 at 1:18 PM, Bryan Lewis <jb...@gmail.com> wrote:
> Rockin'!  Works like a charm.  The only drawback was that the table name in
> the second database needs to be unique, but I can work around that by
> renaming the conflicting table on my side.
>
> Thanks!
>
>
> On Thu, May 17, 2012 at 9:31 AM, Michael Gentry <mg...@masslight.net>wrote:
>
>> Hi Bryan,
>>
>> I'm not sure you need two DataDomains.  Have you tried:
>>
>> DataDomain
>>  DataMapForDB1
>>  DataNodeForDB1
>>  DataMapForDB2
>>  DataNodeForDB2
>>
>> Then make sure that the DataNode for DataMapForDB1 is DataNodeForDB1
>> and the DataNode for DataMapForDB2 is DataNodeForDB2.
>>
>> mrg
>>
>>
>> On Thu, May 17, 2012 at 8:06 AM, Bryan Lewis <jb...@gmail.com>
>> wrote:
>> > We need to fetch objects from a second database.  (That is, query an
>> entity
>> > in a second domain.)  I've tried a couple of quick things -- putting two
>> > domains in one cayenne.xml project -- but I've been unable to make it
>> work,
>> > in Cayenne 3.0.2 anyway.
>> >
>> > I found CAY-1318 which says, "Multi-datadomain runtime configurations
>> offer
>> > no advantage over multiple configurations with a single domain each.  So
>> > going to change the project structure to only support a single
>> > DataDomain."  It says it was fixed in 3.1.
>> >
>> > So if we upgrade to 3.1 will we have an easier time?  Are there any
>> > examples of querying from multiple configurations?
>> >
>> > Thanks,
>> > Bryan Lewis
>>

Re: multiple database querying

Posted by Bryan Lewis <jb...@gmail.com>.
Rockin'!  Works like a charm.  The only drawback was that the table name in
the second database needs to be unique, but I can work around that by
renaming the conflicting table on my side.

Thanks!


On Thu, May 17, 2012 at 9:31 AM, Michael Gentry <mg...@masslight.net>wrote:

> Hi Bryan,
>
> I'm not sure you need two DataDomains.  Have you tried:
>
> DataDomain
>  DataMapForDB1
>  DataNodeForDB1
>  DataMapForDB2
>  DataNodeForDB2
>
> Then make sure that the DataNode for DataMapForDB1 is DataNodeForDB1
> and the DataNode for DataMapForDB2 is DataNodeForDB2.
>
> mrg
>
>
> On Thu, May 17, 2012 at 8:06 AM, Bryan Lewis <jb...@gmail.com>
> wrote:
> > We need to fetch objects from a second database.  (That is, query an
> entity
> > in a second domain.)  I've tried a couple of quick things -- putting two
> > domains in one cayenne.xml project -- but I've been unable to make it
> work,
> > in Cayenne 3.0.2 anyway.
> >
> > I found CAY-1318 which says, "Multi-datadomain runtime configurations
> offer
> > no advantage over multiple configurations with a single domain each.  So
> > going to change the project structure to only support a single
> > DataDomain."  It says it was fixed in 3.1.
> >
> > So if we upgrade to 3.1 will we have an easier time?  Are there any
> > examples of querying from multiple configurations?
> >
> > Thanks,
> > Bryan Lewis
>

Re: multiple database querying

Posted by Michael Gentry <mg...@masslight.net>.
Hi Bryan,

I'm not sure you need two DataDomains.  Have you tried:

DataDomain
  DataMapForDB1
  DataNodeForDB1
  DataMapForDB2
  DataNodeForDB2

Then make sure that the DataNode for DataMapForDB1 is DataNodeForDB1
and the DataNode for DataMapForDB2 is DataNodeForDB2.

mrg


On Thu, May 17, 2012 at 8:06 AM, Bryan Lewis <jb...@gmail.com> wrote:
> We need to fetch objects from a second database.  (That is, query an entity
> in a second domain.)  I've tried a couple of quick things -- putting two
> domains in one cayenne.xml project -- but I've been unable to make it work,
> in Cayenne 3.0.2 anyway.
>
> I found CAY-1318 which says, "Multi-datadomain runtime configurations offer
> no advantage over multiple configurations with a single domain each.  So
> going to change the project structure to only support a single
> DataDomain."  It says it was fixed in 3.1.
>
> So if we upgrade to 3.1 will we have an easier time?  Are there any
> examples of querying from multiple configurations?
>
> Thanks,
> Bryan Lewis