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 Pushpaka Rambukkanage <pu...@eurocenter.lk> on 2003/08/04 15:00:27 UTC
Read the repository mapping file from outside
hi all,
I am a new comer to ojb world and I got some problem with the ojb mapping file reading.
I need to read the repository.xml, repository_user.xml,.. files from a java code. it is to create a object hierarchy from the mappings and do some processing on them
my problem is how the obj read the mapping files to get the configurations, then I can follow the same method to read the file. I tried several methods and failed.
I hope someone will help me in this problem.
thanks
indrajith rambukkanage
Re: Read the repository mapping file from outside
Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi,
start OJB (rc4 or CVS) with an "empty" repository, see
http://db.apache.org/ojb/faq.html
section: Start OJB without a repository file?
Then use MetadataManager to read metadata from an InputStream
public ConnectionRepository readConnectionRepository(InputStream inst)
public DescriptorRepository readDescriptorRepository(InputStream inst)
then merge results using one of the merge methods.
HTH
regards,
Armin
----- Original Message -----
From: "Pushpaka Rambukkanage" <pu...@eurocenter.lk>
To: <oj...@db.apache.org>
Sent: Monday, August 04, 2003 3:00 PM
Subject: Read the repository mapping file from outside
hi all,
I am a new comer to ojb world and I got some problem with the ojb
mapping file reading.
I need to read the repository.xml, repository_user.xml,.. files from a
java code. it is to create a object hierarchy from the mappings and do
some processing on them
my problem is how the obj read the mapping files to get the
configurations, then I can follow the same method to read the file. I
tried several methods and failed.
I hope someone will help me in this problem.
thanks
indrajith rambukkanage
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Read the repository mapping file from outside
Posted by Danilo Tommasina <dt...@risksys.com>.
Instead of writng own java code for parsing the repository.xml, you can customise the velocity templates for ojb and run the ant task 'project-om' in build-torque.xml
So you can generate and format the java code as you want.
> hi all,
> I am a new comer to ojb world and I got some problem with the ojb mapping
> file reading.
>
> I need to read the repository.xml, repository_user.xml,.. files from a java
> code. it is to create a object hierarchy from the mappings and do some
> processing on them
>
> my problem is how the obj read the mapping files to get the configurations,
> then I can follow the same method to read the file. I tried several methods
> and failed.
>
> I hope someone will help me in this problem.
>
> thanks
> indrajith rambukkanage
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org