Podmiot rodzajowe, super klasę:Hibernacja: Jak zastąpić atrybut z odwzorowanym super klasy
@MappedSuperclass
public abstract class GenericEntity {
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
}
pojo:
@Entity
@Table(name = "POJO_ONE")
@SequenceGenerator(name = "HB_SEQ_POJO_ONE", sequenceName = "SEQ_POJO_ONE", allocationSize = 1)
public class PojoOne extends GenericEntity {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "HB_SEQ_POJO_ONE")
@Column(name = "ID")
@AttributeOverride(name = "id", column = @Column(name = "ID"))
private Integer id;
@Override
public Integer getId() {return id;}
}
próbuję użyć thoses adnotacji: @AttributeOverride, @Id, ... ale to nie działa. Możesz mi pomóc? Chcę zastąpić atrybut "id", aby określić inną nazwę kolumny i sekwencję według pojo/table. Jaki jest najlepszy sposób na zrobienie tego?
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4380 – axtavt