Entity Groups, JPA and the one write per second limit (app engine)

jack2023

New Member
I have two entities, parent and child, that have a OneToMany relationship. The parent has an @Owned annotation for the child class. There is no relationship back. (from child to parent)\[code\]@Entitypublic class Parent { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Owned @OneToMany(fetch = FetchType.LAZY) private Set<Child> children; .........}@Entitypublic class Child { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Key id; public String value; ......... public int hashCode() { ... based on this.value ... } public boolean equals(Object o) { ... based on this.value ... }}\[/code\]Question 1: Does this setup resemble an entity group where Parent is the ancestor? The following two statements do return an equal Key:\[code\]- child.getId().qv.getId().getParent()- KeyFactory.createKey("Parent", parent.getId())\[/code\]Question 2: Should the following code take about ten seconds to execute? It runs in about 223 milliseconds:\[code\]for(int i = 0; i < 10; i++) { em.getTransaction().begin(); parent = em.find(Parent.class, parentId); child = new Child("value" + i); parent.addChild(child) em.merge(parent) em.getTransaction().commit();}\[/code\]Thanks
 
Back
Top