GORM多对多映射引发的问题
xiao0556
2008-06-17
以前多对多映射都没有用过List方式,现在需要一个有序的列表结果报错 下面是代码:
class Student { //科目 static hasMany = [subjects:Subject] List subjects } class Subject { static mapping = { table 'cto_subject' } static belongsTo = Student static hasMany = [students:Student] String name } 直接保持Subject里出错 errors.GrailsExceptionResolver org.springframework.dao.InvalidDataAccessResourceUsageException: could not insert: [Subject]; nested exception is org.hibernate.exception.DataException: could not insert: [Subject] 这是什么原因造成的? |
|
right
2008-06-17
从以上信息,原因我判断不出来,娃哈哈
|