I am planning to put a bunch of XObjects (up to ~20) into one page. These objects can relate to each other. I’m not quite sure how to build the relationship. Would Database List be an appropriate type? I’ve tried that and it seems in the object editor (just for testing, I’ll store the objects later by calling the API) I can select the page containing the object, but not an object itself.
I guess I could store the object id in a text field. But that feels more like a hack.
Since I want to reference an object within the same document, I arrived at this query (guid seems fine since I’m not using the built-in UI widgets but am building my objects in JavaScript and saving with API calls):
select o.guid from BaseObject as o, XWikiDocument doc
where o.name = doc.fullName
and o.className = 'Integrations.Code.ImplementationClass'
Is there integrity checking, such that an object can’t be deleted when it is referenced? Or perhaps some sort of cascading when deleting objects?
I noticed that when changing the property value using the REST API, I can set values which should not be allowed according to the Hibernate Query. So I suppose the query is only used for providing options for the UI widget? Would there be a way to achieve something like a foreign key, to ensure no invalid values are set?