Hy,
I'm just trying to get into Castor, so please tell me if I've overlooked
something obvious. I'm experimenting with Castor, 'cause we ponder using it
for a bigger project. It seems perfect for our needs (apart from the
trouble with self releations, but we'll try to overcome that). To get a
grip on Castor I'm trying to convert a very simple web-based dictionary to
Castor (actually I'm re-implementing it using Castor). I've got a simple
class Word, built somthing like that:
package com.tpsoft.lexikon;
public class Word {
private int id;
private String name;
private String description;
/* [snip public getter/setter-methods for all of these, the ones for id are
called getID and setID] */
}
now I've got an entry in my mapping.xml which is
<class name="com.tpsoft.lexikon.Word" identity="ID" key-generator
="HIGH/LOW" auto-complete="true">
<map-to table="words" xml="word" />
</class>
If I understood the documentation correctly auto-complete tells castor to
use Introspection to find the fields. But when I execute a simple
Test-Programm i get
org.exolab.castor.mapping.MappingException: No field descriptor found for
the identity field ID in class com.tpsoft.lexikon.Word
when using JDO.loadConfiguration() to load this mapping.xml. Shouldn't
Castor use introspection to find getID/setID of Word?
Ok, so I assume that Castor can't use Introspection to find the ID-Field
for some reason, so I add
<field name="ID" type="integer" />
to the <class>-Tag, but then I get an differenct exception, that I can't
interpret:
org.exolab.castor.mapping.MappingException: Nested error:
java.lang.IllegalArgumentException: Identity field must be of type
JDOFieldDescriptor
Could anyone shed some light on this for me?
Another question: Is there a more JDO-specific Documentation to the
Mapping-XML-File? I only found the one in the XML-Section and although it's
quite useable it sometimes refers to the JDO-Documentation (for example
concerning the identity-attribute of the class-tag) but I can't find
anything there.
all in all, thx for what seems to be a great product.
regards
Joachim Sauer
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev