SourceForge.net Logo

How to retrieve the openMDX URI for a given instance?

To retrieve the openMDX URI of a given object, the JMI operation refMofId can be called on the desired object.

Example 6-2. Retrieve the openMDX URI of a given object

// retrieve the openMDX URI of a given object
String personUri = person.refMofId()

To retrieve an object for a given openMDX URI, you use the operation refObject on the root package (or any other package) for this purpose.

Example 6-3. Retrieve the object for a given openMDX URI

// retrieve the object (e.g. a Person instance) for a given openMDX URI
RefObject person = rootPkg.refObject(personUri);

The refObject operation is an openMDX extension and therefore not JMI compliant.