Wednesday, 15 April 2015

How to specify sequence on non-id column in Grails? -



How to specify sequence on non-id column in Grails? -

i trying map column in grails sequence, column not id.

integer seqcol

i have tried next code in static mapping, i'm switching 'id' 'colum'.

column name: "seqcol", generator: "sequence", params:[sequence:"sequence_name"]

this returns error on save, saying seqcol cannot null leads me believe mapping failed.

in order alter name of id property, need specify name id property.

integer seqcol static mapping = { id name: 'seqcol', column: 'seq_col', generator: "sequence", params:[sequence:"sequence_name"] }

grails

No comments:

Post a Comment