Hello,
whoops, that was a copying error, the classes are named different, I
just added a second class-descriptor to make the example clearer.
What I meant: PRODUCTION.USER and TEST.USER
I want to switch the PRODUCTION to TEST and vice versa during
runtime.
Here is the correct XML:
<class-descriptor class="User" table="PRODUCTION.USER">
.........
</class-descriptor>
<class-descriptor class="Order" table="PRODUCTION.ORDER">
.........
</class-descriptor>
and the second XML is
<class-descriptor class="User" table="TEST.USER">
.........
</class-descriptor>
<class-descriptor class="Order" table="TEST.ORDER">
.........
</class-descriptor>
Lasse
|---------+--------------------------->
| | [EMAIL PROTECTED]|
| | de |
| | |
| | 16.09.03 16:48 |
| | Bitte antworten |
| | an "OJB Users |
| | List" |
| | |
|---------+--------------------------->
>-------------------------------------------------------------------------------------------------------------------------------|
|
|
| An: [EMAIL PROTECTED]
|
| Kopie:
|
| Thema: RE: Using different Qualifiers in DB2
|
>-------------------------------------------------------------------------------------------------------------------------------|
Hello Lasse,
> -----Original Message-----
>
> <class-descriptor class="User" table="PRODUCTION.USER">
> .........
> </class-descriptor>
> <class-descriptor class="User" table="PRODUCTION.ORDER">
^^^^
I suppose you mean 'Order' here?
> .........
> </class-descriptor>
>
> and
>
> <class-descriptor class="User" table="TEST.USER">
> .........
> </class-descriptor>
> <class-descriptor class="User" table="TEST.ORDER">
^^^^
ditto.
> .........
> </class-descriptor>
>
> - The qualifier depends on what the user has choosen at the login
of
> our application
> - It's a webbased application
>
> Is there a way I can set the qualifier at runtime in order to
switch
> between them?
Something like (untested)
mdm = org.apache.ojb.broker.metadata.MetadataManager.getInstance();
dr = mdm.getDescriptorRepository();
cld = dr.getDescriptorFor(User.class);
cld.setTableName("TEST.USER");
might work. Given that in your application several users access the
database with different qualifiers, you may have to switch back and
forth and care abot multithreading. I do not know what happens then,
maybe someone else can help.
Olli
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]