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 "Charles N. Harvey III" <ch...@alloy.com> on 2004/03/26 20:17:54 UTC

repository.xml in a jar

Hello.
I am trying to build an interface to a particular database and package it
all up in a jar.  Then have this jar included in other applications.  The
thing is, I want to keep the OJB.properties and repository.xml inside the
jar, since it does not change.  If the application that will house this
jar has mappings of its own, how do I make OJB see both sets of 
configurations?
Is there way to do this?  Can I give repositoryFile multiple xml files:

#------------------------------------------------------------------------
# repository file settings
#------------------------------------------------------------------------
# The repositoryFile entry tells OJB to use this file as as its standard
# mapping repository. The file is looked up from the classpath.
#
repositoryFile = repository.xml, repository-ldap.xml
#------------------------------------------------------------------------

Or, should I create a properties file with a different name, 
OJB-LDAP.properties
and then have that call repository-ldap.xml?  Then I would have to set a
system property telling OJB where to find the new properties file, but
wouldn't that then make OJB not see the original one?

Yes, my head is spinning over this one.  And I haven't even asked about the
LDAP stuff yet.  ;)  Found a free jar on Novell that makes any LDAP server
look like a relational database, so I can use OJB!!

Any tips are welcomed.  Thanks a lot.


Charlie


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: repository.xml in a jar

Posted by Stefan Schlösser <ss...@intermediate.de>.
Hi,

we have similar Problems when copying data from one db to another.

You could use the same include mechanism ojb is using i.e. &user.xml to 
point to a "custom" xml in the file system. You'd just have to include 
an empty file with your code.

Otherwise you could also modify the ojb repository at run-time, there is 
  some kind of interface to it. You'd then just have your own property 
files to control the behaviour.

Cheers,
   Stefan


Charles N. Harvey III wrote:

> Hello.
> I am trying to build an interface to a particular database and package it
> all up in a jar.  Then have this jar included in other applications.  The
> thing is, I want to keep the OJB.properties and repository.xml inside the
> jar, since it does not change.  If the application that will house this
> jar has mappings of its own, how do I make OJB see both sets of 
> configurations?
> Is there way to do this?  Can I give repositoryFile multiple xml files:
> 
> #------------------------------------------------------------------------
> # repository file settings
> #------------------------------------------------------------------------
> # The repositoryFile entry tells OJB to use this file as as its standard
> # mapping repository. The file is looked up from the classpath.
> #
> repositoryFile = repository.xml, repository-ldap.xml
> #------------------------------------------------------------------------
> 
> Or, should I create a properties file with a different name, 
> OJB-LDAP.properties
> and then have that call repository-ldap.xml?  Then I would have to set a
> system property telling OJB where to find the new properties file, but
> wouldn't that then make OJB not see the original one?
> 
> Yes, my head is spinning over this one.  And I haven't even asked about the
> LDAP stuff yet.  ;)  Found a free jar on Novell that makes any LDAP server
> look like a relational database, so I can use OJB!!
> 
> Any tips are welcomed.  Thanks a lot.
> 
> 
> Charlie
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org