L'entità generica, super classe:Hibernate: Come ignorare un attributo da mappato super classe
@MappedSuperclass
public abstract class GenericEntity {
private Integer id;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
}
Il 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;}
}
cerco di usare thoses annotazioni: @AttributeOverride, @Id, ... ma non funziona. Mi potete aiutare? Voglio sovrascrivere l'attributo "id" per specificare un altro nome di colonna e una sequenza per pojo/tabella. Qual è il modo migliore per farlo?
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4380 – axtavt