Hi All,

Is it a regular occurance to have the Database and XML mappings in the same
mapping file? I already have some objects that are stored in my database,
how would I go about writing them out as XML? I've looked through the
documentation on the site and it seems that XML and Database handling are
not mentioned in the same mapping files.

I also have a strange table structure (if it feels strange, it's probably
wrong?) that looks like this:

EntityInstance: id, name

EntityData: id, instanceId, data1, data2...

The idea was that there are going to be many instances of EntityData for
each EntityInstance. So I put the EntityInstance id into the EntityData
table as a foreign key (instanceId). The actual operations I have to do to
put records into the database are:

- Create or obtain the EntityInstance for 'name'.
- Get it's id, and write each EntityData record with the instanceId set to
that.

Why do this? Well, in my world, 'name' is very long and I have many
instances of EntityData and didn't want to repeat the instance name. I think
this is standard practice.

What I'm confused about with Castor is how do I properly model my Java
classes? What should the mapping files look like in order to put these Java
objects in the database, and also write them out as XML when I want to
archive the records?

Thanks for any help you can give. I hope I've been clear enough.

-Neal

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

Reply via email to