Hey Jorrit,

it's great to see you making progress! I'll try to give you a short and simple 
answer:
Since the JDOManager is managed and instantiated by your IoC container 
(Spring), this piece of code is already implemented by Castor. Just wire 
everything up as in the example on the website [1].
Let us know if you can fix it!

Best,
Lukas

[1] http://castor.codehaus.org/reference/html/jpa.html#d0e8744



Am 26.05.2010 um 16:00 schrieb Jorrit Wortel:

> Hello everyone,
> 
> After having (successfully) Marshalled and Unarshalled data from XML to Java 
> and from Java to XML, I'm now trying to make things a bit harder: I'm adding 
> the relational database.
> 
> That is, I'm trying to pass data from an XML (or java, doesn't matter) to a 
> relational database.
> I did the following (conforming to the doc):
> - Adding the JPA annotations to my class (Person.java)
> - Implementing the CastorDaoSupport with its interface (the same way it has 
> been done in the doc)
> - Creating a spring-config.xml
> - Creating a jdo-conf.xml
> 
> But in the doc it is said I have to add this piece of code :
> JDOClassDescriptorResolver resolver = new JDOClassDescriptorResolverImpl();
> resolver.addClass(org.castor.jpa.Single.class);
> // or alternatively you can add the package:
> resolver.addPackage("org.castor.jpa");
> 
> InputSource jdoConfiguration = ...;
> JDOManager.loadConfiguration(jdoConfiguration, null, null, resolver);
> 
> JDOManager jdoManager = JDOManager.createInstance("jpa-extensions");
> 
> The only point is: where do I have to add it ???
> 
> It seems to be Java code but in wich class file do I have to put it ?
> 
> If anyone could help me, that would be very appreciated !
> 
> Best regards,
> Jorrit Wortel

Reply via email to