Как хранить сложные объекты? У меня есть объект в своем списке дочерних объектов, в дочернем объекте есть четыре списка дочерних объектов, при вызове makePersistent (person) объект не сохраняется. Помощь !!!!!!!!!!!!
Я звоню pm.makePersistent (); но списки
@Persistent
private List<ChoosedElementEntity> choosedElements = new ArrayList<ChoosedElementEntity>();
@Persistent
private List<PleasantElementEntity> pleasantElements = new ArrayList<PleasantElementEntity>();
@Persistent
private List<UnpleasantElementEntity> unpleasantElements = new ArrayList<UnpleasantElementEntity>();
@Persistent
private List<SetViewElementEntity> setViewElements = new ArrayList<SetViewElementEntity>();
не сохранено !!!
пример:
@PersistenceCapable(table = "persons", identityType = IdentityType.APPLICATION)
public class PersonEntity {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
@Persistent
private List<OfferEntity> offers = new ArrayList<OfferEntity>();
}
@PersistenceCapable(table = "offers", identityType = IdentityType.APPLICATION)
public class OfferEntity {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;
@Persistent
private List<ChoosedElementEntity> choosedElements = new ArrayList<ChoosedElementEntity>();
@Persistent
private List<PleasantElementEntity> pleasantElements = new ArrayList<PleasantElementEntity>();
@Persistent
private List<UnpleasantElementEntity> unpleasantElements = new ArrayList<UnpleasantElementEntity>();
@Persistent
private List<SetViewElementEntity> setViewElements = new ArrayList<SetViewElementEntity>();
}
@PersistenceCapable(table = "offer_selections", identityType = IdentityType.APPLICATION)
public class ChoosedElementEntity {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;
@Persistent
private String code;
@Persistent
private Text cmComments;
}
@PersistenceCapable(table = "offer_selections", identityType = IdentityType.APPLICATION)
public class PleasantElementEntity {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;
@Persistent
private String code;
@Persistent
private Text cmComments;
}
@PersistenceCapable(table = "offer_selections", identityType = IdentityType.APPLICATION)
public class UnpleasantElementEntity {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;
@Persistent
private String code;
@Persistent
private Text cmComments;
}