JDO stability in a Google App Engine application with a HashMap child field

I have a parent class and I want to save a HashMap in it. However, every time I try to change this HashMap, I get the following error:

PM org.datanucleus.store.appengine.MetaDataValidator checkForIllegalChildField WARNING. It is not possible to verify the one-to-many relationship. Com.monsters.server.MonUser.monsters

Any idea what this is about? Here is the code:

This is the parent class code

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") 
public class MonUser {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

    @Persistent(serialized="true", mappedBy = "owner")
    @Element(dependent = "true")
    private HashMap<String,Monster> monsters;

...

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class Monster {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

    @Persistent
    private MonUser owner;

...

I tried everything on the appengine page on relationships and nothing helps. Any information would be very helpful!

PS I got it for working with ArrayLists, etc., but not hashmaps, hashtables, maps, etc. If that helps at all.

+3
source share
2

JDO Collections:

  • java.util.ArrayList<...>
  • java.util.HashSet<...>
  • java.util.LinkedHashSet<...>
  • java.util.LinkedList<...>
  • java.util.List<...>
  • java.util.Set<...>
  • java.util.SortedSet<...>
  • java.util.Stack<...>
  • java.util.TreeSet<...>
  • java.util.Vector<...>
+3

HashMap :

@Persistent(serialized = "true", defaultFetchGroup="true")

. JDO - HashMap

, HashMap, : http://gae-java-persistence.blogspot.de/2009/10/serialized-fields.html

0

Source: https://habr.com/ru/post/1784206/