JPA - Persisting a Unidirectional One to Many relationship fails with EclipseLink
Use nullable = false
, on @JoinColumn
:
@JoinColumn(name = "service_id", nullable = false)
Try removing the not null constraint on the Parameter table's service_id field. Eclipselink will update the foreign key for unidirectional 1:m join columns in a separate statement, so you'll need to disable or delay the constraint check. Making it bidirectional will allow the fp field to be updated with the rest of the parameter data.