Hi Chris,
Unfortunatelly to me, I need follow the already defined database structure, and it has a large number of composite keys like this:
@Entity
@IdClass(AtAtendimentosPK.class)
@SequenceGenerator(name = "AtendimentoSeq", sequenceName = "ATATE_SEQ",
allocationSize = 1)
public class AtAtendimentos implements Serializable {
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "AtendimentoSeq")
//@GeneratedValue(strategy=GenerationType.SEQUENCE, sequence = "ATATE_SEQ")
@Column(name = "NUM_ATENDIMENTO", nullable = false)
private Long numAtendimento;
@Id
@Column(name = "COD_MAQ_ATE", nullable = false)
private Long codMaqAte;
....
}
Althought I've defined a PK key class exactly how is showned in web's available samples, Hibernate don't query the ATATE_SEQ sequence object to obtain a new value, what leads to an SQLExcecption "Attempt to insert null value at column NUM_ATENDIMENTO"
Any suggests?
Alexandre
|