Appengine - java persistent

I have 3 classes with relationship:

  • Member 1-n Tracker
  • Link 1-n Tracker

with a one-to-many bidirectional relationship

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Member {
        @PrimaryKey
        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
        private Key key;

        @Persistent(mappedBy = "member")
        private List<Tracker> trackers;

}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Link {
        @PrimaryKey
        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
        private Key key;

        @Persistent(mappedBy = "link")
        private List<Tracker> trackers;

}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Tracker {
        @PrimaryKey
        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
        private Key key;

        @Persistent
        private Member member;

        @Persistent
        private Link link;

} 

      

I am creating a new tracker:

member = new Member();
member.name = "blah";

link = new Link();
link.url = "http://blahblah.blah";

tracker = new Tracker();
tracker.setMember(member);
tracker.setLink(link);

pm.makePersistent(tracker);//error

      

he throws

The class "The class "zodpob.model.Tracker" is not persistable. This
means that it either hasnt been enhanced, or that the enhanced version
of the file is not in the CLASSPATH (or is hidden by an unenhanced
version), or the Meta-Data/annotations for the class are not found."
is not persistable. This means that it either hasnt been enhanced, or
that the enhanced version of the file is not in the CLASSPATH (or is
hidden by an unenhanced version), or the Meta-Data for the class is
not found.

      

what does "improved" mean?

if i am a persistent class with no relationship it works well

+1


a source to share


1 answer


Make sure you are using the DataNucleus plugin ....

Here is their website ...

link text

... here is how to install it on Eclipse IDE ...



link text

... and is used here for use with JDO ....

link text

I hope this helps and good luck.

+2


a source







All Articles