I’m trying to write a simple inheritance on JDO (NetBeans, not Eclipse. And not for GAE). This is very simple:
@PersistenceCapable
@Inheritance(strategy=InheritanceStrategy.NEW_TABLE)
public class TestModel1 {
}
and
@PersistenceCapable
@Inheritance(strategy=InheritanceStrategy.NEW_TABLE)
public class TestModel2 extends TestModel1 {
}
But I get the following error when I tried to build it
type com.ncr.model.QTestModel1 does not take parameters
public class QTestModel2 extends com.ncr.model.QTestModel1<TestModel2> implements PersistableExpression<TestModel2>
com.ncr.model.QTestModel2 is not abstract and does not override abstract method jdoVersion() in org.datanucleus.query.typesafe.PersistableExpression
public class QTestModel2 extends com.ncr.model.QTestModel1<TestModel2> implements PersistableExpression<TestModel2>
I’ve been spending hours on this and no answer on Google nor here before. Please help >.<
EDIT:
Here’s my QClass result
public class QTestModel1 extends org.datanucleus.jdo.query.PersistableExpressionImpl<TestModel1> implements PersistableExpression<TestModel1>
{
public static final QTestModel1 jdoCandidate = candidate("this");
// not important
}
And
public class QTestModel2 extends com.ncr.model.QTestModel1<TestModel2> implements PersistableExpression<TestModel2>
{
public static final QTestModel2 jdoCandidate = candidate("this");
// not important
}
It fails here:
public class QTestModel2 extends com.ncr.model.QTestModel1<TestModel2> implements PersistableExpression<TestModel2>
I don’t know how come Netbeans generate QTestModel2 that extends QTestModel1 which in turn cause the compile error. And I’m not sure changing that manually will solve any problem.
Firstly, you neglect to mention that you’re using DataNucleus Typesafe API (presumably, since JDO doesn’t, as yet, include that).
Secondly, DataNucleus SVN has tests that have inheritance of typesafe classes and have no problems. So suggest you debug your problem by looking at the (generated) source code for those QTestModel1/QTestModel2 classes.