Hi, 1.) Yes, you can have inheritance relationships. I use the following: @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
2.) It looks like your problem isn't with the inheritance but is because you must have in your Partido class a field which is defined as Resultado and thus you can not assign an instance of Empate to that field because GAE doesn't support poymorphic queries. If the field is defined as Resultado, then only Resultado instances may be assigned (no subclass instances). What I do to get around this limitation is store the keys (actually the string representations of the ids) for my relationships and then perform my own queries getting the child objects from the appropriate tables. Hope this helps, Steve On Jul 24, 9:34 pm, lisandrodc <lisandr...@gmail.com> wrote: > Hi! I have a problem when I attempt persist an object,calling the next > code: > > par1 = new Partido("ss", new Empate(), > eq1b, eq2b, fecha, hora); > > //The class "Empate" extends of class "Resultado", and the error says: > > "Received a child of type model.Empate for a field of type > model.Resultado. Unfortunately polymorphism in relationships is not > yet supported." > I read the documentation of google but he does not say anything, > neither he denies the support of the inheritance. It wanted to know if > really he supports. > The classes(Have I some mistake in the annotations for the > inheritance???): > > @PersistenceCapable(identityType = > IdentityType.APPLICATION,detachable="true") > @Inheritance(customStrategy = "complete-table") > public class Resultado implements Serializable{ > @PrimaryKey > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > private Long id; > private static final long serialVersionUID = 3039288063578312662L; > public Long getId() { > return id; > } > public void setId(Long id) { > this.id = id; > } > public static long getSerialversionuid() { > return serialVersionUID; > } > > } > > @PersistenceCapable(identityType = > IdentityType.APPLICATION,detachable="true") > @Entity > public class Empate extends Resultado implements Serializable { > @PrimaryKey > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > > private Long id; > private static final long serialVersionUID = 3039288063578312662L; > public Long getId() { > return id; > } > public void setId(Long id) { > this.id = id; > } > public static long getSerialversionuid() { > return serialVersionUID; > } > > } > > Thanks and Regards > Lisandro -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.