Hi all,

I'm trying to use a mapping file with castor, to describe how to marshal.
But it seems to me the mapping file is not used :(. I'm using the latest cvs
version.

mapping.xml
---------------

<!DOCTYPE databases PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
                           "http://castor.exolab.org/mapping.dtd";>
<mapping>


 <class name="com.subshell.xxx.Folder" identity="id" key-generator="MAX">
  <description>Folder</description>
  <map-to table="ts_obj_folder" xml="test"/>
  <field name="name" type="string">
   <sql name="obj_folder_name" type="char"/>
   <xml node="attribute"/>
  </field>
  <field name="id" type="integer">
   <sql name="obj_folder_id" type="numeric"/>
   <xml node="attribute"/>
  </field>
 </class>

</mapping>


marshalcode
----------------

Mapping mapping = new Mapping();
mapping.loadMapping(this.getClass().getResource("/mapping.xml"));

root = (Folder)db.load(Folder.class, new Integer(0));

Marshaller marshaller = new Marshaller(response.getWriter());
marshaller.setMapping(mapping);

marshaller.marshal(root, response.getWriter());


the output
----------

<?xml version="1.0"?>
<folder position="0" ro-flag="0"><name>Desktop</name><id>0</id></folder>



Thanks for your help and this great framework,
Christoph

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

Reply via email to