> NABETH Thierry wrote:
> 
> Hello,
> 
> >> What would you like to see as far as documentation and tutorials?
> Please let us know so that we can improve those things.
> 
> >> BTW, there are examples for both Castor JDO and Castor XML in
> src/examples.
> 
> That is not totally correct.
> There are very important aspects that have very little
> description, and do not have examples.
> 
> For instance in the xml mapping, the use of the references
> or the use of collections.
> 
> For instance I have big difficulty to marshall
> / unmarshall collections of string.
> Do I have to use the type="strings", or
> collection="array" and type="string", etc.

Use

collection="array" type="string".

Works fine for me. I coded up your example from your other thread:

<filter>
  <contexts>blablabla</contexts>
  <contexts>blablabla</contexts>
  <contexts>blablabla</contexts>
</filter>

Works just fine with the following class:

public class Filter {
    
    private String[] _contexts = null;
    
    public Filter() {
        super();
    }
    
    public String[] getContexts() {
        return _contexts;
    }
    
    public void setContexts(String[] contexts) {
        _contexts = contexts;
    }
    
} //-- class: Filter

and following mapping file:

<?xml version="1.0"?>
<mapping>
  <class name="Filter">
    <field name="contexts" collection="array" type="string"/>
  </class>
</mapping>
   
> 
> Basic (validated) examples would be welcome.
> 

The above works.

> Note:
> A few months ago, a collegue of mine tried to propose
> some guidelines for using references, but our feedback
> was not incorporated to the doumentation.

Who is your colleague?

> (we are not even sure that we had the correct way to
> proceed).

Proceeed in what respect?

> We had spent a lot of time trying to understand how
> it was working, and define a small process how to use
> it, and we wanting to share our experience
> (so that people do not spent the same time as we did,
> and as other people have).
> 

--Keith

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

Reply via email to