I have an Entity A which has a OneToOne relationship with Entity B. I use the Springframework to setup the EntityManager. When I create a new Entity A and set anything on this Entity it throws an throwable error.
java.lang.NoSuchMethodError: com.sample.EntityA._persistence_checkFetched(Ljava/lang/String;)V
I'm looking for some direction on how to solve the problem.
try {
EntityA entityA = buildEntityA(criteria);
persistEntity(entityA);
}
catch(Throwable th) {
logger.error("", th);
}
private EntityA buildEntityA(criteria) {
EntityA entityA = new EntityA();
EntityB entityB = resolveEntityB(criteria);
entityA.setEntityB(entityB); // <-- location of when the error is thrown
}
@Entity
public class EntityA implements Serializable {
private Long id;
private EntityB entityB;
... accessors/mutators
}
@Entity
public class EntityB implements Serializable {
private Long id;
... accessors/mutators
}