oracle.toplink.essentials.exceptions.DescriptorException

刘成礼
2023-12-01
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;
	}

 

 类似资料:

相关阅读

相关文章

相关问答