What is the ideal Grails class domain for this tree structure -


i'm developing website need categories sub categories.

my current domain class is:

package com.abc  class category {      string title     string description     category parent      static hasmany = [children: category, listing: listing]      static constraints = {         title blank: false         description blank: true     }  } 

but gives me error:

property [children] in class [class com.abc.category] bidirectional one-to-many 2 possible properties on inverse side. either name 1 of properties on other side of relationship [category] or use 'mappedby' static define property relationship mapped with. example: static mappedby = [children:'myprop']

i use category parent. can children category.findallbyparent. easiest solution use later on in tree creation.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -