1
Good morning, I have the following problem
Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-01400: não é possível inserir NULL em ("XXGOVC"."ASSINATURA"."ID_DIRETRIZ")
And here is the mapping of my entities...
@Entity
@Table(name = "DIRETRIZ")
public class Diretriz {
@Id
@Column(name = "ID_DIRETRIZ", nullable = false)
@GeneratedValue(generator="ID_DIRETRIZ_SEQ", strategy=GenerationType.SEQUENCE)
@SequenceGenerator(sequenceName="ID_DIRETRIZ_SEQ", name="ID_DIRETRIZ_SEQ", allocationSize=1)
private Long idDiretriz;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "diretriz", orphanRemoval=true)
private Set<Assinatura> assinaturas;
and...
@Entity
@Table(name = "ASSINATURA")
public class Assinatura{
@Id
@Column(name = "ID_ASSINATURA", nullable = false)
@GeneratedValue(generator="ID_ASSINATURA_SEQ", strategy=GenerationType.SEQUENCE)
@SequenceGenerator(sequenceName="ID_ASSINATURA_SEQ", name="ID_ASSINATURA_SEQ", allocationSize=1)
private Long idAssinatura;
@ManyToOne
@JoinColumn(name = "ID_DIRETRIZ")
private Diretriz diretriz;
I have already researched and read the documentation and apparently the mappings are all correct, will someone tell me if this is all right, if I’m forgetting something... I thank you in advance
Thanks for the reply, I really did not know it was necessary to do this, even so I did as you said and it did not work
– William Witter da Silva
Guy was really this, the first time did not give because I still had one more list that was not doing it... vlw even
– William Witter da Silva
I got it...
– Arthur Vidal