Java action: retrieve first object only

3
I need to get/retrieve an object based on an attribute which is unique hence i would like to retrieve the first object only. With Core.retrieveXpathQuery a List is returned. Is there a way to get the object based on attribute (without GUID or id)
asked
2 answers
4

If you know the attribute is unique, can't you just grab the first entry from the List and use that?

answered
-1
Core.retrieveId(context, Core.createMendixIdentifier(guid));
answered