开发者

Hibernate subclass to override a column

We have an Entity library untouched by our web stack, but our web stack would like to extend existing columns on existing entities with validation constraints. Here's one example of the "goal":

@Entity
@Table(name="Person")
public class WebPerson extends Person {
    @Ov开发者_高级运维erride
    @Validate("require")
    public String getName() { return super.getName(); }
}

Is this possible? We can't use InheritanceType.SINGLE_TABLE because that mandates a silly DTYPE. Person as MappedSuperclass gives us a "Duplicate property mapping of" error. Help! Thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜