2017-03-19 9 views
0

フィールドはnullableとして設定されていますが、フォームがそれを読み込んでいるときに例外が発生します。Grails、従来のDBのnull値はPropertyAccessExceptionを返します

これで、プリミティブintをIntegerに変更することで、最終的に解決しました。以下の答えでそれを見てください。

エラー:

Caused by: org.hibernate.PropertyAccessException: 
Null value was assigned to a property of primitive type setter of 
com.mytrading.legacy.RoleType.copyToXOR 

ドメイン:

class RoleType { 
    int copyToXOR 


static constraints = { 
    copyToXOR   nullable:true 

} 

}

答えて

0

私は整数でint型を置き換えることによって、問題を解決し、それはそれは、少なくともだレガシーデータベースで動作するようですそれが私が必要とするものです。

class RoleType { 
    Integer copyToXOR 


static constraints = { 
    copyToXOR   nullable:true 
関連する問題