我正在从另一个项目中包装以下类。它不应该注释Hibernate注释:从另一个项目的类继承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
超不沾响应超?
谢谢,这解决了我的问题。我将定义移到了方法中(并且我没有使用mappedsuperclass标签。) – ndrizza 2012-08-13 11:57:22