我设置了3个班。ClassA
分别具有ClassB
和的 FK ClassC
。我在我的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;
}
我得到以下异常
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)])
我做了一些搜索,我可以找到一些关于挥动静态加载或其他东西的旧线程。有人可以提出解决方案吗?
PS:我正在使用 weblogic 10 和 eclipselink2