2012-05-14 9 views
-1

을 이해할 수없는이 오류입니다 :나는 다음과 같은 오류

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)]

내가 다른 클래스에서 목록을 사용 한 오류를 이해할 수 있지만, 다른 클래스에 관계를 가지고, 그들은 다른 유형이 있었다 클래스하지만 여기 왜 내가 목록의 유형을보고하지 않습니다 이해가 안돼

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>(); 
} 
+1

향후 질문을 위해 더 많은 질문을하는 텍스트를 사용하여 자신이 말하는 것을 알 수있는 사람들이 더 많은 의견을 얻을 수 있습니다. – digitaljoel

답변

1

JPA는 문자열 목록을 올바르게 매핑하는 방법을 모를 것이다. ElementCollection으로 매핑하면 JPA가 처리하는 방법을 알 수 있습니다.

+0

감사합니다. – hadeer

관련 문제