hibernate - Grails domain mapping property name to column identified as id but has different name than property -
i have seen several questions seem close subject doesn't seen reply totally. here is. have legacy table not changed. relevant schema there table column called licnum. column must used primary key. set descriptive property names in domain classes. map property name licensenumber column.
now have read grails documentation , understand should accomplished mapping:
id name:'licensenumber' ,column:'licnum', generator:'assigned'
however when utilize mapping hibernate still looking license_number column in database. know doing wrong?
i have done below successfully. doing in mapping closure?
static mapping = { id column:'licnum' }
see examples in documentation:
http://grails.org/doc/latest/ref/database%20mapping/id.html
hibernate grails mapping gorm
No comments:
Post a Comment