Performing Joins and Searches using IFS Search API's
Hello All:
I've been trying to formulate a search using the IFS Search API. I would appreciate it if someone could provide me with assitance. Here is a description of what I am trying to achieve.
I have a document object and several application objects that this document object refers to. To be more specific
DA_PDI extends from DOCUMENT ( A ClassObject we created for our project extending from Document)
DA_PDI has several attributes besides the ones inherited from its parent class. While some of the attributes are
flat attributes some of them are references to other class objects.
DA_PDI (has the following attributes)
------
PDI_IDENTIFIER (flat attribute)
PDI_OBJECT_LOCATOR (refers to a PublicObject Array of Application Objects of the type DA_OBJECT_LOCATOR)
PDI_TITLE (refers to a PublicObject Array of Application Objects of the type DA_TITLE)
Note, that while creating a document object (an instance) of the kind DA_PDI, I also create relationships between the Document
object (LeftObject) and the Application Objects (RightObject). This was a recommendation made to me as it was felt that these relationships would help while formulating JoinQualifications.
How would I join the DA_PDI Document Object with the DA_OBJECT_LOCATOR and DA_TITLE (ApplicationObjects) and get
back the following three object types DA_PDI, DA_OBJECT_LOCATOR, DA_TITLE in a single resultset object.
Given all the above this is what I am trying to accomplish in psuedo SQL terms
CREATE CURSOR THAT CONTAINS
SELECT
PDI.IDENTIFIER,
PDI.attribute2,
PDI.ID
FROM
ODM_DA_PDI
FOR EVERY ROW IN THE CURSOR GET ME ALL THE RELATED DA_OBJECT_LOCATOR OBJECTS
SELECT
DA_OBJECT_LOCATOR OBJECTS
FROM
ODM_DA_OBJECT_LOCATOR
ODM_RELATIONSHIP
WHERE
ODM_DA_OBJECT_LOCATOR.ID = ODM_RELATIONSHIP.RIGHTOBJECT
AND
ODM_RELATIONSHIP.LEFTOBJECT = ID READ FROM CURSOR
ALSO FOR EVERY ROW IN THE CURSOR GET ME ALL THE RELATION DA_OBJECT_LOCATOR OBJECTS
SELECT
DA_TITLE OBJECTS
FROM
DA_TITLE
DA_RELATIONSHIP
WHERE
ODM_DA_TITLE.ID = ODM_RELATIONSHIP.RIGHTOBJECT
AND
ODM_RELATIONSHIP.LEFTOBJECT = ID READ FROM CURSOR
THEN I NEED TO SOMEHOW COMBINE THE RESULTS OF THE ABOVE QUERIES AND GET ALL THE OBJECTS
BACK AS ROWS OF ONE RESULTSET OBJECT
Is there a way to formulate this using the IfsSearch API's OR do I have to breakdown the search into multiple
steps (still using the IfsSearch API's).
Any input is appreciated. Code snippets will be a huge help.
Thanks a bunch
Mathangi