Dear all,

I between the questions and answer regarding the OR Mapping, I think it is
necessary for me to tell you the scenario...

I am in the midst of developing a tool that can edit XML data, and load the
XML data to the relational database. I find that Castor has the capability
to cater XML (Castor XML) and relational database (Castor JDO). To date, i
have already successfully generated java objects using the source generator
that Castor provides. My tool will load the XML data to the java objects and
to be loaded to the relational database using JDO.create(rootElementObject)
to the database.

Here the problem arise. I notice that I dont need to use XML to Java mapping
 but I think I still need the OR mapping right? I use the third party tool
(JDOMapper) in helping me to simplify the mapping. However, when it comes to
a relation shown below, I can't handle it with castor although with the help
of the myapp example that show 1:N, N:1 and M:N cardinalities.

<project id="id">
    <name>Project A</name>    
    <developers>
        <developer name="id">
            <name>Ng Keng Yap</name>
            <email>[EMAIL PROTECTED]</email>
          </developer>
    <developers>
</project>

In the above sample xml database, we can see there will be 3 java objects to
be created by the source generator, namely: project.java, developer.java and
developers.java

In fact, developers.java is the wrapper of developer collection. Developers
java will have getter and setter for developer in array. Here is the problem
 how can I map this to the database as:

project(id, name);
developer(id, project_id, name, email)

the relationship between project:developer is 1:N.

Can anybody here tell me how to do this in JDO? What is the mapping then?

THANKS for your patient in reading thru this long-winded email.


Best regards,
Ng Keng Yap

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to