db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Jefferson <a...@jpox.org>
Subject Re: JIRA JDO-68
Date Wed, 03 Aug 2005 10:59:20 GMT
> One question: JPOX does not complain if the ORM metadata for a class
> specifies fields which do not exist in that class. Would it be an option
> to throw a JDOFatalUserException("ORM metadata of class XXX specifies
> column mapping for field YYY. This field does not exist in the class.")
> in this case?

Hi Michael,

Well in my tests JPOX *does* complain about situations of incorrectly named 
fields. Here's an example

public class Simple
{
    String name;
}

<jdo>
    <package name="org.jpox.test">
        <class name="Simple">
            <field name="name"/>
        </class>
    </package>
</jdo>

<orm>
    <package name="org.jpox.test">
        <class name="Simple">
            <field name="name2"/>
        </class>
    </package>
</orm>
    
and it gives "An exception was thrown during the operation of SchemaTool. 
Please refer to the log for full details. The following may help : 
org.jpox.metadata.InvalidMetaDataException: Class org.jpox.test.Simple has 
field org.jpox.test.Simple.name2 declared in MetaData, but this field doesnt 
exist in the class!"


-- 
Andy

Mime
View raw message