One of my mappings causes this errror:
org.hibernate.MappingException: Foreign key (FK9B753AD0E180CB50:TESTANSWER [TESTSENTENCEID])) must have same number of columns as the referenced primary key (TESTSENTENCE [TESTID,SENTENCEID])Can anyone see what's wrong?
Code:
@Entity
@Table(name = "TESTSENTENCE")
public class TestSentence implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "TESTSENTENCEID")
private Long testSentenceId;
@ManyToOne
@JoinColumn(name = "TESTID")
private Test test;
@ManyToOne
@JoinColumn(name = "SENTENCEID")
private Sentence sentence;
Code:
@Entity
@Table(name = "TESTANSWER")
public class TestAnswer implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "TESTANSWERID")
private Long testAnswerId;
@ManyToOne
@JoinColumn(name = "TESTSENTENCEID")
private TestSentence testSentence;