我正在包装来自另一个项目的以下类。不应使用 Hibernate 注释对其进行注释:
public class Response
{
private String access;
...
public String getAccess()
{
return this.access;
}
public void setAccess(String access)
{
this.access = access;
}
...
}
这是我当前项目中的“包装类”(用于持久性)。然而,超类的属性Response
没有被映射。(例如。 )(仅映射Access
添加的属性。)entry_id
@Entity
@Table(name = "ruleEngineResponse")
public class RuleEngineResponse extends Response
{
@Id
@Column(name = "entry_id")
private Long entry_id = -1L;
public void setId(Long entry_id)
{
this.entry_id = entry_id;
}
public Long getId()
{
return this.entry_id;
}
// Problem: this property is not mapped
@Column(name = "access")
@Override
public String getAccess()
{
return super.getAccess();
}
...
}
我如何配置RuleEngineResponse
以映射Response
超类的属性而不触及响应超类?