Hello,
In my current application using the trunk build of sling, I'm trying
to model a many-to-many relationship between Users and Regions. I'm
setting up all my nodes via a bundle that uses the Sling/Jackrabbit
API directly, and I can create all the nodes and properties correctly,
I cannot use the reference between User and Region via my URL.
I use localhost:8181/content/users/user_a.json which shows me that the
'regions' property I have set is an array of Region node jcr:uuids.
But if I do localhost:8181/content/users/user_a/regions.json, I get no
response nor exception. If I create a non-multiple Region reference
to a random element of my Region set, I can properly use localhost:
8181/content/users/user_a/region.json and traverse the reference. But
no matter what I try, I cannot retrieve the multiple Region references.
All of my nodes are nt:unstructured with mix:referenceable. I create
them via the JCR api and add the mixin, as well as all of my
properties. I use the following line of code to set the regions
property:
userNode.setProperty("regions", regionNodeSet.toArray(new Region[]
{}), PropertyType.REFERENCE);
If I query that property, it is a PropertyType.REFERENCE and
isMultiple() is true. What am I doing wrong?
-Jason
- Property with Multiple References Jason Rose
-