Hi. I have some base classes I use for a group of classes. Something like:
public class Base {
// a bunch of bean style getters and setters.
}
public class Something extends Base {
// different getters and setters
}
public class SomeOtherThing extends Base {
// you get the picture...
}
When objects are instantiated, they are always instantiated as Something or
SomeOtherThing objects. When I go to marshall them, I always cast them into Base
objects because that is all I want marshalled. However, I always get the fields from
Something and SomeOtherThing.
In fact, in the xml output, the class attribute is always the fully qualified class
name of the instantiated class, not the base class.
I have tried a mapping and using the "extends" attribute, but that did not work
either. In that case, the output had something like some-other-thing as the class
name, which I seem to recall is a castor name mangling convention.
I thought I could do this in the mapping :
<class name="SomeOtherThing" extends="Base" />
<class name="Base">
... all of my mapping for the base class fields here.
</class>
Can anyone offer a bit of insight? Am I just missing the concept or missing a
setting?
Thanks
Rick
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user