Grails composite id throwing NullPointerException -
i have grails 2.2.3 domain class throwing nullpointerexeption regarding composite id when use dynamic scaffolding. use pidm
field primary key, occasionally there 2 records same pidm
(same employee, maybe there name change or something) , grails has trouble /show/ uri because multiple rows returned. changeindicator
comes in - if changeindicator null, current employee. i'm wondering if problem pidm , changeindicator of 2 different types.
does know error might be?
below class , error:
class employee implements serializable { integer pidm string sid string firstname string lastname string middleinitial character changeindicator static mapping = { table 'employee' id composite: ['pidm', 'changeindicator'] columns { pidm column: 'pidm' changeindicator column: 'change_ind' // more mappings } version false }
error:
uri /phoneauth/employee/list class java.lang.nullpointerexception message cannot property 'id' on null object
your primary issue hibernate not allow nullable column part of composite primary key.
secondarily, grails scaffold plugin not handle composite keys well.
Comments
Post a Comment