I have set up 3 classes. ClassA has FK of ClassB and ClassC respectively. I have put up the following lines in my ClassA
@Entity
@Table(name="ClassA")
public class ClassA{
//rest of the code
@OneToOne(fetch=FetchType.LAZY, targetEntity=ClassB.class)
@JoinColumn(name="ClassB_ColA", columnDefinition="ClassB_ColA", updatable=false, insertable=false)
private ClassB classB;
@OneToOne(fetch=FetchType.LAZY, targetEntity=ClassC.class)
@JoinColumn(name="ClassC_ColA", columnDefinition="ClassC_ColA", updatable=false, insertable=false)
private ClassC classC;
}
and i am getting following exception
Exception [EclipseLink-60] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The method [_persistence_set_classB_vh] or [_persistence_get_classB_vh] is not defined in the object [project.persistence.entities.ClassA].
Internal Exception: java.lang.NoSuchMethodException: project.persistence.entities.ClassA._persistence_get_classB_vh()
Mapping: org.eclipse.persistence.mappings.OneToOneMapping[classB]
Descriptor: RelationalDescriptor(project.persistence.entities.ClassA --> [DatabaseTable(ClassA)])
I did a little bit search and i could find some old threads saying about waving static loading or something. Can someone suggest a solution ?
P.S:
I am using weblogic 10 and eclipselink2
The problem was related to static wavingo f the objects. So what i did that i changed the loading mechanism.
From
ClassB, i didn’t load anything forClassAand forClassA, I kept the lazy loading .. and it worked fine.