Hello Keith,
>> Works just fine with the following class:
>> ...
Thank you.
I will try to test this in my development environment.
>>> 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?
RACHAMADUGU Sunil.
See your answer:
http://castor.exolab.org/list-archive/msg13049.html
and in particular:
------
You shouldn't need this method...Castor should do the lookup for you
automatically.
------
I remember at this time that it didn't work automatically.
Perhaps, this was due to a bug in my development environment.
But we didn't find the xml-mapping documentation cristal clear about
the correct way of using references (which appear to be an important
things if we work with graphs and not only trees).
Of course, we first bumped initially in the problem of the marshalling
duplicating the elements conducing to the generation of huge file
when we only try to use the introspection mechanism (no mapping file).
For instance try to marshall without a mapping file a list which
include several identical objects. (castor marshall the same
object several time). Nothing indicate this clearly in the documentation.
(and when you marshall a complex java object, you just expect that
by default it will be aware of pointers, like is is the case for rmi).
So my remark in the previous posting was just that:
A few clarification of the process to use in some important (and tricky) cases
of use of castor and examples would be welcome here.
To conclude, I find some of the concept/architecture of Castor very
interesting. But my personal experience (I do not consider myself
a very skilled java programmer, but I am not a beginner) is that
it sometimes requires more efforts to use it than you initialy envisaged,
and that a few more examples would help reducing this effort.
Thierry.
-----Original Message-----
From: Keith Visco [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 11, 2002 9:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] newbie question about Persistent interface
> 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
