this is the error:
A JPA error occurred (Unable to build EntityManagerFactory): Could not determine type for: java.util.List, at table: Question, for columns: [org.hibernate.mapping.Column(Choices)]
i can’t understand the error i have used lists in other classes but they had relations to other classes, they had types of other classes but here i don’t understand why isn’t he seeing the type of the list
package models;
import play.*;
import play.db.jpa.*;
import javax.persistence.*;
import java.lang.reflect.Array;
import java.util.*;
@Entity
public class Question extends Model{
public String theQuestion;
public int marks;
public List<String> Choices;
@ManyToOne
@JoinTable (name="questionInEexercise")
public Exercise myExercise;
public Question(String question,int marks,long Eid){
this.theQuestion = question;
this.marks = marks;
this.myExercise = Exercise.findById(Eid);
Choices = new ArrayList<String>();
}
JPA won’t know how to map your list of Strings correctly. You could map it with an ElementCollection so JPA would know how to handle it.