Can I reuse a column across subclasses in a Hibernate table-per-hierarchy inheritance strategy?
问题 In a simple inheritance tree, an abstract superclass has two subclasses. The subclasses both store a key-value pair, but but one will be holding a type Encrypted String, and the other one a plain old String. Now, my question is can I do this: @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public abstract Attribute { @Id private Integer id; @Column(name="attribute_key") private String key; } @Entity public EncryptedAttribute extends Attribute { @Column(name="attribute_value")