Is there a different list that this should be posted to? Possibly the
'dev' list?! I've dug through the Castor docs and can't seem to find a
clear example of how to handle a situation with interfaces. There's
some stuff about interfaces in the XML mapping section of the docs,
but it seems like that might be the reverse of what this project is
doing.
Either way, I'm not clear on why this works in 0.9.5.3 and not in 0.9.6?!
I believe this is the relevant portion of the docs:
If 'direct' is set to false or omitted, Castor will access the
property though accessor methods. Castor determines the signature of
the accessors and mutators as follows: If the 'get-method' or
'set-method' attributes are supplied, it will try to find a function
with the following signature:
public <type> <get-method>();
or
public void <set-method>(<type> value);
What I'm asking is - if the <type> specified in the mapping is an
implementation (so it can be instantiated) and the <type> in the
Javabean code is the Interface implemented, how is this handled in
Castor 0.9.6? Seems to work fine in 0.9.5.3 without anything
additional specified in the
mapping.xml file. I believe this is a 'complex' field, if you will ...
a parent-child relationship.
I would certainly appreciate any thoughts or pointers. If this is
better discussed on the 'dev' list - I can take the conversation over
there, too.
Thanks again,
Brice
On 5/16/05, Brice Ruth <[EMAIL PROTECTED]> wrote:
> I am modifying an existing Open Source application to support SAP DB
> with the lastest Castor snapshot. This system is written against
> Castor 0.9.5.3, so I had to change the database.xml file slightly for
> 0.9.6.
>
> That said, Castor appears to be having some problems with entries
> defined like so:
>
> <field name="contentTypeDefinition"
> type="org.infoglue.cms.entities.management.impl.simple.ContentTypeDefinitionImpl">
> <sql name="contentTypeDefinitionId"/>
> </field>
>
> The class provided for the 'type' is an implementation of
> org.infoglue.cms.entities.management.ContentTypeDefinition, which is
> what the signature for getContentTypeDefinition() is written against,
> for the object that is being mapped.
>
> However, Castor complains that the return type of the bean
> (ContentTypeDefinition) differs from that specified in the mapping
> (ContentTypeDefinitionImpl). Why is this?! This seems to be a change
> from 0.9.5.3, since the application runs just fine against that
> version of Castor.
>
> Insights? I'm all ears!! Thanks a ton.
>
> p.s. I am a Castor newbie, 100% greenhorn.
>
> --
> Brice Ruth
> Software Engineer, Madison WI
>
--
Brice Ruth
Software Engineer, Madison WI