title: Hibernate: fetching a set of objects in an entity mapping
body: <p>I've got an entity Case that has an id CaseId (unfortunately a string due to compability with a legacy system). This id is foreign key in the table Document, and each Case can have many documents (onetomany). I've put the following in my Case entity:</p>
  
  <pre><code>@Id
  @Column(name = "CaseId", length = 20, nullable = false)
  private String caseId;
  
  @OneToMany(fetch=FetchType.EAGER)
  @JoinColumns ( {
      @JoinColumn(name="caseId", referencedColumnName="CaseId")
  } )
  private Set&lt;Document&gt; documents;
  </code></pre>
  
  <p>The table for Document contains "CaseId varchar(20) not null". Right now, in the database, all cases have six documents. Yet when I do myCase.documents().size, I only ever get a single document. What should I do to get all the documents?</p>
  
  <p>Cheers</p>
  
  <p>Nik</p>