Grails - SQL NULL not allowed for column Error during a find -
i'm working on ggts 3.4 - whilst creating new instance of domain model videodisplaymgmtshr have introduced query check on content of domain model of h2 db prior creating new instance of domain. here query:
def viddispmgmlst = videodisplaymgmtshr.findall{ displaymode == videodisplaymgmtshrinstance.displaymode}
the error is:
class: org.h2.jdbc.jdbcsqlexception message: null not allowed column "expiry_date"; sql statement: insert video_display_mgmt_shr ...
if remove check query save of new instance works fine - expirydate not null. doubly confused query not creating new instance don't see why should throw error? expirydate set of null allowable in model definition.
one last thing domain model has belongsto constraint domain model - being taken care of in create.
the domain class is:
class videodisplaymgmtshr { // defines management of videos published static constraints = { description(blank:true, nullable:true) startdate(blank:true, nullable:true) expirydate(blank:true, nullable:true) pubrights(inlist:["full", "rest"]) // full - full publish rights //rest- restricted rights - watermark concessionary publishing displaymode(inlist:["vanilla", "vimeo", "youtube"]) } static mapping = { datasource 'publish' } string description date startdate = new date() date expirydate = new date() + 100 string pubrights = "rest" // display type string displaymode = "vanilla" // type/ destination of publication static belongsto = [ publishedbt: publishedshr]
}
with domain class belongto' domain class:
static hasmany = [viddmhm: videodisplaymgmtshr] // links display management entry
not sure relevant has mapping condiution:l
static mapping = { datasource 'publish' viddmhm cascade: "all-delete-orphan" }
has seen before?
-mike
Comments
Post a Comment