on 04-26-2007 4:01 PM
Hi,
I got problem with retrieving leaf and non-leaf nodes from hierarchy table. Does anybody know the solution? Thanks.
There are two records with name "abc" in my hierarchy table. One "abc" is leaf node and another "abc" is non-leaf node in hierarchy view.
I tried to retrieve all two records of "abc" by calling MDM Java API "RetrieveLimitedRecordsCommand".
I got one record and missed another record.
The missing record is the non-leaf node in hierarchy view.
Here are some code:
RetrieveLimitedRecordsCommand retrieveLimitedRecsCmd = new RetrieveLimitedRecordsCommand(this.getConnectionPool());
retrieveLimitedRecsCmd.setSession(this.getUserSession());
Search search = new Search(searchTableId);
FieldSearchDimension searchDim = new FieldSearchDimension(searchFieldId);
TextSearchConstraint textConstraint = new TextSearchConstraint(searchValue, TextSearchConstraint.EQUALS);
search.addSearchItem(searchDim, textConstraint);
search.setComparisonOperator(Search.OR_OPERATOR);
retrieveLimitedRecsCmd.setSearch(search);
ResultDefinition resultDef = new ResultDefinition(tableId);
FieldId []a_searchFieldIds = ...........;
resultDef.setSelectFields(a_searchFieldIds);
resultDef.setFieldSelectionType(ResultDefinition.ALL_FIELDS);
retrieveLimitedRecsCmd.setResultDefinition(resultDef);
retrieveLimitedRecsCmd.execute();
RecordResultSet resultSet = retrieveLimitedRecsCmd.getRecords();
return resultSet.getRecords();
You should <b>not</b> use RetrieveLimitedRecordsCommand to retrieve Hiearchy table records.
You should try using RetrieveLimitedHierTreeCommand or RetrieveLimitedHierChildrenCommand for Hiearchy Tables.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It works by using RetrieveLimitedHierTreeCommand for one repository. But it doesn't work for another repository
class HierResultSet exists in the SAP Java API, but looks like RetrieveLimitedHierTreeCommand doesnt return HierResultSet. How to use HierResultSet?
Message was edited by:
Forrest Lin
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.