日期:2014-05-17  浏览次数:20644 次

hibernate list<String> 用注解怎样写
Java code




@Entity
@Table(name="_question")
public class Question {

    private int id = 0;
    /**
     * 试题正文
     */
    private String title = null;
    /**
     * 试题给出的提示
     */
    private List<String> chooses = null;

         ...................................

    public List<String> getChooses() {
        return chooses;
    }
    public void setChooses(List<String> chooses) {
        this.chooses = chooses;
    }

         ...................................

}




chooses的Annotation应该怎么写?

------解决方案--------------------
一般情况都是用Set 可能是用来强调记录不能重复把
------解决方案--------------------
领分了