I tried using the following query:
Query q = getPersistenceManager().newQuery(
getPersistenceManager().getExtent(ICommentItem.class, false)
);
but got:
org.datanucleus.exceptions.NoPersistenceInformationException: The class
“com.sampleapp.data.dataobjects.ICommentItem” is required to be persistable yet no Meta -Data/Annotations can be found for this class. Please check that the Meta-Data/annotations is defined in a valid file location.
I saw in the Datanucleus forum somebody suggested (a few years ago) using :
<interface name=IComment/>
I tried that but it didn’t create any table when I ran schema-update. Is tag still relavent? I coudnt see anything in docs on it.
I also tried :
<class name=IComment/>
But that gave this error when running schema-create:
SEVERE: Error thrown enhancing with ASMClassEnhancer
java.lang.NullPointerException
at org.datanucleus.enhancer.asm.method.DefaultConstructor.execute(DefaultConstructor.java:63)
at org.datanucleus.enhancer.asm.JdoClassAdapter.visitEnd(JdoClassAdapter.java:317)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.datanucleus.enhancer.asm.ASMClassEnhancer.enhance(ASMClassEnhancer.java:388)
at org.datanucleus.enhancer.DataNucleusEnhancer.enhanceClass(DataNucleusEnhancer.java:1035)
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:609)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1316)
Oct 23, 2010 6:46:33 PM org.datanucleus.enhancer.DataNucleusEnhancer addMessage
INFO: ERROR (PersistenceCapable) : com.sampleapp.data.dataobjects.ICommentItem
Oct 23, 2010 6:46:33 PM org.datanucleus.enhancer.asm.ASMClassEnhancer enhance
INFO: Class “com.sampleapp.data.dataobjects.Article” is already enhanced.
Oct 23, 2010 6:46:33 PM org.datanucleus.enhancer.DataNucleusEnhancer addMessage
SEVERE: DataNucleus Enhancer completed with an error. Please review the enhancer log for full details. Some classes may have been enhanced but some caused errors
Failure during enhancement of classes – see the log for details
org.datanucleus.exceptions.NucleusException: Failure during enhancement of classes – see the log for details
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:620)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1316)
Turns out this is not supported at this time but is planned to be added in version 2.2.0M3