0
使用旧数据库中的表存在很多问题。 一个是名为“角色类型”一表,有它的命名“角色类型”Grails,遗留数据库无法获得正确类型的ID
这里ID是域类的重要片段:
class RoleType {
int roleType
....
static mapping = {
table 'RoleType'
version false
id column: 'roleType', type:'int', generator:'assigned'
roleType column: 'RoleType'
错误上市:
Caused by: org.hibernate.PropertySetterAccessException:
IllegalArgumentException occurred while calling setter for property
[com.torntrading.legacy.RoleType.id (expected type = java.lang.Long)];
target = [com.torntrading.legacy.RoleType : (unsaved)], property value = [1]
setter of com.torntrading.legacy.RoleType.id
我能做些什么来解决这个问题?
感谢的,是做到了。我是这种类型的编程新手,学习很多,而且经常混淆视听。现在,我在同一张表中发现了一个新错误,但我认为我应该在新帖子中提出这个错误。 – larand