我收到以下异常
"org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.vzbi.impact.iam.common.models.AutomationCFScripting.ruleId in com.vzbi.impact.iam.common.models.AutomationScriptIds.multiTabSet"
我拥有的实体模式如下,
//trying to map from rowId of AutomationScriptIds to ruleId of AutomationCFScripting with one-to-many
//both rowId and ruleId is available in entity Category which is extended by AutomationScriptIds and AutomationCFScripting
@Entity
@Table(name="AUTOMATION_SCRIPT_IDS")
public class AutomationScriptIds extends Category implements Serializable, MultiTabCategory {
---
@OneToMany(cascade=CascadeType.ALL, targetEntity=AutomationCFScripting.class, mappedBy="ruleId", fetch=FetchType.EAGER)
public Set<? extends Category> getMultiTabSet() {
return getSetValue(RuleFieldKeys.MULTITAB);
}
---
}
@Entity
@Table(name="AUTOMATION_CFSCRIPTING")
public class AutomationCFScripting extends Category implements java.io.Serializable{
-----
}
@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public abstract class Category extends DataMap
{
---
@Id
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "uuid")
@Column(name="ROW_ID")
public String getRowId() {
return getStringValue(RuleFieldKeys.ROW_ID);
}
@Column(name="RULE_ID")
public String getRuleId() {
return getStringValue(RuleFieldKeys.RULE_ID);
}
---
}