I've tried overriding a @Column in a subclass, and it doesn't work. My code appears as follows:
Code:
@Entity public abstract class AuditedEntity {
@Id(generate = GeneratorType.AUTO)
@Basic(optional = false)
@Column(name = "Id", nullable = false)
public abstract Long getId();
public abstract void setId(Long id);
}
The concrete class looks like this:
Code:
@Entity public class UserProfile {
@Basic(optional = false)
@Column(name = "UserId", nullable = false)
public Long getId() { ... }
public void setId(Long id) { ... }
}
This code deploys fine, however it seems that Hibernate ignores the @Column annotation in the base class. Should this approach work? I haven't seen any text in the EJB3 spec. to the contrary. Is this just a limitation of Hibernate?