@MappedSuperclass
public class LocalizedBaseEntity<T> extends BaseEntity {
// the entity for which we hold the localized data
@ManyToOne
private T entity;
private Locale locale;
}
@Entity
@Audited
public class LocalizedEntityA extends LocalizedBaseEntity<EntityA> {
private String name;
// more string fields ...
}
org.hibernate.MappingException: @AuditMappedBy points to a property that doesn't exist: LocalizedEntityA.entity
Sure...
@Entity
@Audited
public class EntityA { @OneToMany(cascade = CascadeType.ALL, mappedBy = "entity") @MapKey(name = "locale") private Map<Locale, LocalizedEntityA> localizations = Maps.newHashMap(); }
@MappedSuperclass
public class LocalizedBaseEntity<T> extends BaseEntity { // the entity for which we hold the localized data @ManyToOne private T entity; private Locale locale; }
@Entity
@Audited
public class LocalizedEntityA extends LocalizedBaseEntity<EntityA> { private String name; // more string fields ... }
org.hibernate.MappingException: @AuditMappedBy points to a property that doesn't exist: LocalizedEntityA.entity