我正在使用grails 3.3.6和hibernate 5.1.3,并具有以下域类
class Member {
List<Photo> photos = new ArrayList<Photo>()
.....
}
class Photo {
...
}
我遇到以下异常
由于:java.lang.IllegalArgumentException:无法设置 java.lang.Long字段将Photo.id转换为java.util.ArrayList 在sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) 在sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) 在sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:58) 在sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36) 在java.lang.reflect.Field.get(Field.java:393) 在org.springsource.loaded.ReflectionFieldReaderWriter.getValue(ReflectionFieldReaderWriter.java:60) 在org.springsource.loaded.ReloadableType.getField(ReloadableType.java:1394) 在org.springsource.loaded.ri.ReflectiveInterceptor.jlrFieldGet(ReflectiveInterceptor.java:1914) 在org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:39) ...省略了186个常见框架