title: Hibernate: a foreign key has the wrong number of column. should be 1
body: <p>I'm trying to map to entities Report and ReportLookup:</p>
  
  <pre><code>@Entity
  public class Report extends AbstractMigrationObject implements Serializable {
      @JsonIgnore
      @Id
      private Long reportId;
      private String reportName;
      private String appName;
      private Integer reportNum;
      private String issue;
      @JsonProperty
      @OneToMany(fetch = FetchType.EAGER)
      @JoinColumns({
              @JoinColumn(name = "reportName"),
              @JoinColumn(name = "appName"),
      })
      private Set&lt;ReportLookup&gt; lookupSet;
  
  @Entity
  public class ReportLookup implements Serializable {
      @JsonIgnore
      @Id
      private Long reportLookupId;
      private String parameterName;
      private String attributeName;
      private String lookupName;
      private Integer sequence;
      private String labelOverride;
      private String defaultValue;
      private Integer required;
      private Integer hidden;
      private String reportName;
      private String operator;
      private Integer multiLookup;
      private Integer reportNum;
      private String appName;
      @ManyToOne
      @JoinColumns({
              @JoinColumn(name = "appName", insertable = false, updatable = false),
              @JoinColumn(name = "reportName", insertable = false, updatable = false)
      })
      private Report report;
  </code></pre>
  
  <p>I don't know how to map composite foreign key. Always get this error:</p>
  
  <blockquote>
    <p>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [persistance-context.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: A Foreign key refering ru.ocrv.ekasui.changemonitoring.maximo.entity.report.Report from ru.ocrv.ekasui.changemonitoring.maximo.entity.report.ReportLookup has the wrong number of column. should be 1</p>
  </blockquote>