Retrieving object using GUID in Java

3
I am trying to write an xpath constraint to retrieve a specific object in Java. I have seen that you can retrieve the GUID, which i have managed to get. But i need to know how to write the xpath query to obtain the object. I want to make it generic so i have passed the entity name as well. So i am assuming that if i have the entity name and GUID i can retrieve the object? Also is it possible to get the list of attributes that object has? This is what i have so far: List<IMendixObject> result = Core.retrieveXPathQuery(context, "//" + objectName + "[" + + "='" + objectID + "']")
asked
3 answers
5

I think this will work. This single quotes might not be needed, depending on the GUID format (which can either be ID_<number> or just <number>):

"//" + objectName + "[id" + "='" + objectID + "']"
answered
2

If you retrieve by a single Id it will always be a single object.

You can use Core.retrieveId(context, id) for that.

The list of attributes is called Members.

BTW The best way to find this is Eclipse.

answered
1

Can one of the AppStore solutions help you, either with the functionality you want to build, or to give you inspiration how to collect object information? Mx Model reflexion or Object Browser

answered