You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Ajitesh Das <ad...@zona.net> on 2004/01/17 02:33:53 UTC
Repository XML limitation and design question.
To all OJB gurus:
First of all this may not be a limitation on OJB what I have wrote as
subject but it seems that there is no easy way to handle this.
Here is my problem :
I like to write a repository XML file [ please note a single repository
file for each case] which captures the following conditions :
I have a set of Databases/data sources = { Da, Db , Dc, ...., Dn }
And I have a set of class-descrptors =
{ { a1, a2, a3 ....,ax},
{b1, b2, b3, ....,by},
:::::::::::::::::::
{n1, n2, n3, ....,nz}}
I want to map ->
Class Descriptors ->{ a1,a2,::::,ax} to be mapped to [Da]
{ b1,b2,::::,by} to be mapped to [Db]
{ c1,c2,::::,cw} to be mapped to [Dc]
:::::::::::::::::::::::::::
{ n1,n2,::::,nx} to be mapped to [Dn]
Case A:
Set (a)i and Set (b)j are disjoint.
That is: any ai != bj where i= 1,2...x
And j= 1,2,...y
Case B:
Set (a)i and Set (b)j are intersect each other.
That is: may be ai == bj where i= 1,2...x
And j= 1,2,...y
Has anybody did this before?
If this can not be done in a single repository xml ...is there any way
it can be worked around?
Thanks
Ajitesh
Re: Repository XML limitation and design question.
Posted by Thomas Mahler <th...@web.de>.
Hello Ajitesh,
Case A works without any problems. You simply define a set of
ConnectionDescriptors and a set of ClassDescriptors in the Repository.
In each ClassDescriptor you have a key pointing to the associated
ConnectionDescriptor.
Case B works too, but needs some consideration. At a given point in a
time given class is associated with exactly one connectionDescriptor.
SO if you want to have a class mapped to several Connections you can do
this only sequentially!
So you you have to simply change the assigned ConnectionDescriptor key
of the ClassDescriptor at runtime. This is done through the Metadata API.
cheers,
Thomas
Ajitesh Das wrote:
> To all OJB gurus:
>
> First of all this may not be a limitation on OJB what I have wrote as
> subject but it seems that there is no easy way to handle this.
>
>
>
> Here is my problem :
>
>
>
> I like to write a repository XML file [ please note a single repository
> file for each case] which captures the following conditions :
>
> I have a set of Databases/data sources = { Da, Db , Dc, ...., Dn }
>
>
>
> And I have a set of class-descrptors =
>
> { { a1, a2, a3 ....,ax},
>
> {b1, b2, b3, ....,by},
>
> :::::::::::::::::::
>
> {n1, n2, n3, ....,nz}}
>
>
>
> I want to map ->
>
> Class Descriptors ->{ a1,a2,::::,ax} to be mapped to [Da]
>
> { b1,b2,::::,by} to be mapped to [Db]
>
> { c1,c2,::::,cw} to be mapped to [Dc]
>
> :::::::::::::::::::::::::::
>
> { n1,n2,::::,nx} to be mapped to [Dn]
>
>
>
> Case A:
>
> Set (a)i and Set (b)j are disjoint.
>
> That is: any ai != bj where i= 1,2...x
>
> And j= 1,2,...y
>
> Case B:
>
> Set (a)i and Set (b)j are intersect each other.
>
> That is: may be ai == bj where i= 1,2...x
>
> And j= 1,2,...y
>
>
>
> Has anybody did this before?
>
>
>
> If this can not be done in a single repository xml ...is there any way
> it can be worked around?
>
>
>
> Thanks
>
> Ajitesh
>
>
>
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org