AW: [Objectbridge-jdo-dev] creating and configuring PersistenceBr oker
Brought to you by:
thma
From: Mahler T. <tho...@it...> - 2002-05-28 07:49:48
|
Hi Travis, > > > What would be the best way to configure the > persistencebrokers without having them read from the repository file? > Brokers actually don't rely on a repository.xml file but on a ojb.broker.metadata.DescriptorRepository! So the real question is: "How to build up a Descriptor repository from a .jdo file?" 1. step: in OJ.properties set repositoryFile=repository.jdo 2. step: change the method ojb.broker.metadata.RepositoryPersistor.readFromFile as follows public DescriptorRepository readFromFile(String filename) throws MalformedURLException, ParserConfigurationException, SAXException, IOException { if (filename.endsWith(".xml")) { return buildRepository(filename); } else if (filename.endsWith(".jdo")) { return buildRepositoryFromJdo(filename); } else { throw new PersistenceBrokerException("can't parse " + filename); } } 3. step: implement the new method private DescriptorRepository buildRepositoryFromJdo(String repositoryFileName) in this method you will parse the jdo file and generate a DecsriptorRepository from it. As far as I can see there is no need to have a extra classes like ojb.jdo.metadata.MetaClass as all this is already there in ojb.broker.metadata.ClassDescriptor. 4. change your JDOManagerFactory to use PersistenceBrokerFactory.createrBroker("repositoty.jdo") instead of "repository.xml". HTH, Thomas > Example: for jdo impl, the metadata gets read in, then when > calling PersistenceManagerFactory.getPersistenceManager() the > broker associated with the Manager should be filled > configured with the jdo metadata. > > Travis > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-jdo-dev mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-jdo-dev > |