Here's a select sampling of ours...
Code:
@MappedSuperclass
public abstract class HibernateDomainObject {
protected String uuid;
@Transient
public String getUuid() {
return this.uuid;
}
}
@MappedSuperclass
public abstract class UUIDHibernateDomainObject extends HibernateDomainObject {
@Column(name = "UUID", unique = false, nullable = false, insertable = true, updatable = false)
public String getUuid() {
return super.getUuid();
}
}
@MappedSuperclass
public abstract class AuditableHibernateDomainObject extends UUIDHibernateDomainObject {
private AuditInfo auditInfo;
protected AuditableHibernateDomainObject() {
this.auditInfo = new AuditInfo();
}
@Embedded
public AuditInfo getAuditInfo() {
return this.auditInfo;
}
public void setAuditInfo(AuditInfo auditInfo) {
AuditInfo oldValue = this.auditInfo;
this.auditInfo = auditInfo;
firePropertyChange(AUDIT_INFO_PROPERTY, oldValue, this.auditInfo);
}
}
We then either come right off the AuditableDomainObject in most of the cases with some cases having another 1 or 2 layers of @MappedSuperClass before getting to the actual entity.
If those are you complete classes, how do you access the private properties?
The other thing I just noticed is that hibernate is reporting the exception as createDateTime rather than DATE_TIME_CREATED which would indicate it's not picking up your name= piece of the annotation.
I've also tried specifying the annotation at the field level in my case and it seems to be working fine.
The only other difference I can see is that your BaseDemographics is a concrete class but I can't see that being an issue either.