oracle.toplink.essentials.exceptions.DescriptorException

xiaoxiao2021-03-01  16

Exception [TOPLINK-60] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DescriptorException Exception Description: The method [_toplink_setattribute_vh] or [_toplink_getattribute_vh] is not defined in the object [cn.ctit.vcms.entity.ActorAttribute]. Internal Exception: java.lang.NoSuchMethodException: cn.ctit.vcms.entity.ActorAttribute._toplink_getattribute_vh() Mapping: oracle.toplink.essentials.mappings.OneToOneMapping[attribute] Descriptor: RelationalDescriptor(cn.ctit.vcms.entity.ActorAttribute --> [DatabaseTable(titan.actor_attribute)])

 

上面是异常信息。

 

解决办法:实体的原因

1. Actor.java @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "actor") public Set<ActorAttribute> getActorAttributes() { return this.actorAttributes; }

 

2.ActorAttribute.java @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "attribute_id") public Attribute getAttribute() { return this.attribute; }

 

上面的配置中两个都是成了LAZY,所有才报错了,解决办法,吧下面那个改成@ManyToOne(fetch = FetchType.EAGER)就好了,即是:

@ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "attribute_id") public Attribute getAttribute() { return this.attribute; }

 

转载请注明原文地址: https://www.6miu.com/read-3350299.html

最新回复(0)