在我的代码中..
List<WeekdayType> weekday = new ArrayList<WeekdayType>();
我将插入weekday
数据库...听到WeekdayType
的是枚举
public enum WeekdayType {
MONDAY(Calendar.MONDAY), TUESDAY(Calendar.TUESDAY), WEDNESDAY(
Calendar.WEDNESDAY), THURSDAY(Calendar.THURSDAY), FRIDAY(
Calendar.FRIDAY), SATURDAY(Calendar.SATURDAY), SUNDAY(
Calendar.SUNDAY);
private int day;
private WeekdayType(int day) {
this.day = day;
}
public int getDay() {
return day;
}}
我正在像这样在 Hibernate 中创建 Bean..
@Entity
@Table(name="EC_TIMETABLE")
public class TimetableVO
{
-------
-----
@Column(name="REPEAT_DAYS")
private List<WeekdayType> repeatDays;
//Setter and Getter...
}
我将值插入数据库,但它给出了错误:
org.hibernate.MappingException: Could not determine type for: java.util.List, at table: EC_TIMETABLE, for columns: [org.hibernate.mapping.Column(REPEAT_DAYS)]