db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-517) NPE on enhancement of classes with persistent properties
Date Wed, 15 Aug 2007 14:33:30 GMT

    [ https://issues.apache.org/jira/browse/JDO-517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519980
] 

Craig Russell commented on JDO-517:
-----------------------------------

The specification for persistent properties of classes is:
• the property element declares the mapping between a virtual field of an implemented 
interface and the corresponding persistent field of the persistence-capable class. 
• the name attribute is required, and declares the name for the property. The naming 
conventions for JavaBeans property names is used: the property name is the same as the 
corresponding get method for the property with the get or is removed and the resulting 
name lower-cased. 
• the mapped-by attribute specifies that the field is mapped to the same database column(s)

as the named field in the other class. 
• the field-name attribute is required; it associates a persistent field with the named

property. 
We had a further discussion via email about which should take precedence in case both persistent
properties and fields were specified. I didn't update the spec with the results of the email
discussion, so for now this test case should be considered a work in progress. Sadly, we don't
have test cases for persistent properties of classes using xml so there's no guidance there.
Would it help to start with an xml test case?

> NPE on enhancement of classes with persistent properties
> --------------------------------------------------------
>
>                 Key: JDO-517
>                 URL: https://issues.apache.org/jira/browse/JDO-517
>             Project: JDO
>          Issue Type: Bug
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 1
>            Reporter: Michelle Caisse
>            Assignee: Andy Jefferson
>
> To reproduce, edit project.propeties, go to the end of the file, and edit out the comment
and blank lines so that the classes in the companyAnnotatedPC package are included in the
argument list to the enhancer.
> 11:39:16,031 (main) ERROR [JPOX.Enhancer] - An error was encountered reading the specified
input files. Please consult the log for details. The following may help : Errors were encountered
when loading the specified MetaData files and classes. See the nested exceptions for details
> Errors were encountered when loading the specified MetaData files and classes. See the
nested exceptions for details
> org.jpox.exceptions.JPOXUserException: Errors were encountered when loading the specified
MetaData files and classes. See the nested exceptions for details
> 	at org.jpox.metadata.MetaDataManager.initialise(MetaDataManager.java:299)
> 	at org.jpox.enhancer.JPOXEnhancer.getFileMetaDataForInput(JPOXEnhancer.java:724)
> 	at org.jpox.enhancer.JPOXEnhancer.main(JPOXEnhancer.java:533)
> Caused by: java.lang.NullPointerException
> 	at org.jpox.metadata.annotations.JDOAnnotationReader.processFieldAnnotations(JDOAnnotationReader.java:1594)
> 	at org.jpox.metadata.annotations.AbstractAnnotationReader.getMetaDataForClass(AbstractAnnotationReader.java:211)
> 	at org.jpox.metadata.annotations.AnnotationManagerImpl.getMetaDataForClass(AnnotationManagerImpl.java:133)
> 	at org.jpox.metadata.MetaDataManager.loadAnnotationsForClass(MetaDataManager.java:1729)
> 	at org.jpox.metadata.MetaDataManager.initialise(MetaDataManager.java:265)
> 	... 2 more
> Nested Throwables StackTrace:
> java.lang.NullPointerException
> 	at org.jpox.metadata.annotations.JDOAnnotationReader.processFieldAnnotations(JDOAnnotationReader.java:1594)
> 	at org.jpox.metadata.annotations.AbstractAnnotationReader.getMetaDataForClass(AbstractAnnotationReader.java:211)
> 	at org.jpox.metadata.annotations.AnnotationManagerImpl.getMetaDataForClass(AnnotationManagerImpl.java:133)
> 	at org.jpox.metadata.MetaDataManager.loadAnnotationsForClass(MetaDataManager.java:1729)
> 	at org.jpox.metadata.MetaDataManager.initialise(MetaDataManager.java:265)
> 	at org.jpox.enhancer.JPOXEnhancer.getFileMetaDataForInput(JPOXEnhancer.java:724)
> 	at org.jpox.enhancer.JPOXEnhancer.main(JPOXEnhancer.java:533)
> java.lang.NullPointerException
> 	at org.jpox.metadata.annotations.JDOAnnotationReader.processFieldAnnotations(JDOAnnotationReader.java:1594)
> 	at org.jpox.metadata.annotations.AbstractAnnotationReader.getMetaDataForClass(AbstractAnnotationReader.java:211)
> 	at org.jpox.metadata.annotations.AnnotationManagerImpl.getMetaDataForClass(AnnotationManagerImpl.java:133)
> 	at org.jpox.metadata.MetaDataManager.loadAnnotationsForClass(MetaDataManager.java:1729)
> 	at org.jpox.metadata.MetaDataManager.initialise(MetaDataManager.java:265)
> 	at org.jpox.enhancer.JPOXEnhancer.getFileMetaDataForInput(JPOXEnhancer.java:724)
> 	at org.jpox.enhancer.JPOXEnhancer.main(JPOXEnhancer.java:533)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message