| Hi Vlad, Petar. I was just trying to update my app release to Hibernate 5.3.4 as i stumbled accross the newly introduced exception. (...Caused by: org.hibernate.AnnotationException: An entity annotated with @Inheritance cannot use @AttributeOverride or @AttributeOverrides...) I have kind of a different setup on my side, but definitely see your point of inconsistent schema definitions. Can you think about the following scenario just for a second? (yes i would LOVE to change my schema right away if i had the possibility, but sadly i cannot change my old and crappy legacy database schema at the moment):
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "setype", discriminatorType = DiscriminatorType.STRING, length = 30)
@Table(name = "BASE")
public abstract class GenericEntry {
protected Long id;
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", unique = true, nullable = false, updatable = false)
@JsonIgnore
public Long getId() {
return id;
}
}
@Entity
@Table(name = "XXX")
@DiscriminatorValue(SetypeIndex.XXX)
@PrimaryKeyJoinColumn(name = "xxxid")
@AttributeOverrides({@AttributeOverride(name = "id", column = @Column(name = "xxxid", unique = true))})
public class CfmsXXX extends GenericEntry {
private Long xxxid;
@Column(name = "xxxid", unique = true, nullable = false, insertable = false, updatable = false)
public Long getXxxid() {
return this.xxxid;
}
}
until now my code was working fine with my crappy legacy schema. Since i will shutdown the old app rather later than soon, i won't be able to change my schema. can you see my point? Maybe you allready know such cases. Best Regards and thanks in advanced, T |