grails - Generator for non-id column -


i'm trying generator work both id column , use sequence different, non-id column.

this doesn't seem anything. column still null after doing save (in integration tests).

   static mapping = {       id generator: 'sequence', params: [sequence: 'id_seq']       othercol generator: 'sequence', params: [sequence: 'other_seq']       version true    } 

to knowledge, generator option works id columns. based on hibernate @generatedvalue used in conjunction @id annotation.

see:

http://grails.github.io/grails-doc/3.0.x/guide/single.html#identity

http://docs.jboss.org/hibernate/core/3.6/reference/en-us/html/mapping.html#mapping-declaration-id-generator

hibernate jpa sequence (non-id)


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -