title: Collection isn't filled with OneToMany relationship - EclipseLink
body: <p>I'm mapping a database (Oracle 11g) to JPA entities using EclipseLink. I have mapped almost every table to JPA objects but I've just found a problem:</p>
  
  <p>In the \Curve\ entity I have the following fields:</p>
  
  <pre><code>@Id
  @Column(name = "COD_CURVE")
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq.gen")
  @SequenceGenerator(name = "seq.gen.curve", sequenceName = "SEQCURVE", allocationSize = 1)
  private long codCurve;
  
  @Id
  @Column(name = "FEC_HISTORIC")
  @Temporal(javax.persistence.TemporalType.DATE)
  private Date fecHistoric;
  
  @OneToMany(mappedBy="codCurve", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  private Collection&lt;CurveDetail&gt; detailsCollection;
  </code></pre>
  
  <p>In the \CurveDetail\ entity I have this:</p>
  
  <pre><code>@ManyToOne
  @JoinColumns({
      @JoinColumn(name = "COD_CURVE", referencedColumnName = "COD_CURVE"),
      @JoinColumn(name = "FEC_HISTORIC", referencedColumnName = "FEC_HISTORIC")
  })
  private Curve codCurve;
  </code></pre>
  
  <p>The problem is that when I query the \Curve\ entity, the details always are null, despite the fact that there is valid data in both tables. Checking the database I've noticed that there are no foreign key constraints in the \CurveDetail\ table, so I wonder ¿Are these constraints required to map the database correctly? I haven't tried to add the FK constraint myself because I'm not allowed to (have to ask a DBA to do it, and it'll take a week).</p>
  
  <p>Thanks in advance!</p>