gorm - grails derived property creating column in database -


i'm using grails 2.4.4.

i have domain

class post {     integer nbroffavorites     static hasmany = [         favorites : favorite     ]      static mappings = {         nbroffavorites formula: '(select count(1) favorite f (f.post_id = id))'     } } 

the problem nbroffavorites being created in database, retrieving doesn't take account formula.

is there wrong in syntax ?

thanks

yes there typo in syntax. change mappings mapping, like:

static mapping = {     nbroffavorites formula: '(select count(1) favorite f (f.post_id = id))' } 

ref# grails domain: mapping


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -