cancel
Showing results for 
Search instead for 
Did you mean: 

MDM API Java - Searching in Taxonomy tables

Former Member
0 Kudos

Hi,

I'm trying to port some code from old MDM4J and put it to work on the new MDM Java API, but I can't find a object that substitute the old classes. Look at this piece of code, please:

	TaxonomyLookupParameter txParameter = new TaxonomyLookupParameter(tableProducts, fieldUnscpsc);
	AttributeParameters params = txParameter.GetAttributes();
	params.NewFeatureParameter(myAttributeId)).Add(Integer.parseInt(myAttributeValue));

	FreeFormTableParameter freeFormTableParameter = new FreeFormTableParameter(tableProducts);
	freeFormTableParameter.GetFields().New(fieldUnscpsc).GetFreeForm().NewString(myFreeTableString, FreeFormParameter.EqualToSearchType);
	Search search = new Search(tableProducts);
	search.Add(freeFormTableParameter);
	search.Add(txParameter);

I'm trying to find a substitute for those classes: TaxonomyLookupParameter, AttributeParameters and FreeFormTableParameter.

Regards

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Please find some sample code.

SearchWithAttributes serAtt =new SearchWithAttributes();
LookupFieldProperties lookupFieldSer = (LookupFieldProperties) serFieldName;
AttributeSearchDimension attLookupType = new AttributeSearchDimension(serFieldName.getId(), serAttName.getId());
TextAttributeValueProperties attValProp = serAtt.serTextAttributeValue(connections, sessionId, lookupFieldSer.getLookupTableId(), serAttName, serFieldValue);
MdmValue[] strValue = { new TextAttributeValue(attValProp.getId()) };
PickListSearchConstraint pickListserConstraint = new PickListSearchConstraint(strValue);
// Searching the record by specifying the Table Name, Field Name andCondition
Search seSearchMainRoot = new Search(new TableId(serTableName.getId()));
// Add the parameters to the search
seSearchMainRoot.addSearchItem(attLookupType, pickListserConstraint);

Thanks,

Priya.