[Helma-user] ORM help
Patrick Lee
patrick at horologe.com.au
Wed Mar 26 02:35:40 CET 2008
Hi,
I'm trying to get my head around the ORM in Helma. Best way to explain
is probably to show what I have. There's a prototype called "Node" and
one called "Tag" each Node can have many tags associated to it and
each tag can be associated to many Nodes.
Node/type.properties includes this:
tag_ids = TAGS
tags = collection(Tag)
tags.accessname = TITLE_SHORT
tags.filter = TAG.ID IN (${NODE.TAGS})
Tag/type.properties includes this:
nodes = collection(Node)
nodes.filter.additionalTables = TAG
nodes.filter = TAG.ID = ${ID} AND FIND_IN_SET(TAG.ID, NODE.TAGS)
I also have all the tags on the root like so:
Root/type.properties:
tags = collection(Tag)
tags.accessname = TITLE_SHORT
The problem I'm having is that whilst I seem to be able to add a Tag
to a Node (eg, this.tags.add(new Node())) and access them via the URL,
every time open the URL for a Node, this.tags.list() is empty.
Any clues? Have I got something wrong here?
More information about the Helma-user
mailing list