私はこのような2つのクラスを持っています
package models;
import java.util.*;
import javax.persistence.*;
import play.db.jpa.*;
@Entity
@Table(name = "commitment_type_value")
public class CommittmentTypeValue extends Model{
@Id
@Column(name = "id", nullable = false)
public Long id;
@Column(name = "value", nullable = true)
public String type;
@ManyToOne
@JoinColumn(name="commitment_type_id")
public CommitementType commitmentType;
public CommittmentTypeValue(){
}
}
-------------
package models;
import java.util.*;
import javax.persistence.*;
import play.db.jpa.*;
/**
*
* @author hatem
*/
@Entity
@Table(name = "commitment_type")
public class CommitementType extends Model{
@Id
@Column(name = "id", nullable = false)
public Long id;
@Column(name = "type", nullable = true)
public String type;
@OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL, mappedBy="commitmentType")
public List<CommittmentTypeValue> commitmentTypeValues;
public CommitementType(){
}
}
アプリを実行すると、この問題が表示されます:
JPA エラーが発生しました (EntityManagerFactory を構築できません): models.CommittmentTypeValue からの models.CommitmentType を参照する外部キーの列数が正しくありません。2である必要があります
何が悪いのか誰か教えてください。