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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -