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.
精彩评论