cancel
Showing results for 
Search instead for 
Did you mean: 

Search Criteria in MDM Java API's

Former Member
0 Kudos

Hi all

I am using MDM 5.5 Java API's in WD Java. In a particular scenario, I am using the NumericSearchConstraint() along with FieldSearchDimension(fieldId) and am getting the error.

Is this the correct way???

My aim is to search a particular column (field) whose type is integer(say) for a particular value.

the piece of code I am using is:

Search search = new Search(mainTableId);

FieldSearchDimension numDim1 = new FieldSearchDimension(fieldProp[1].getId());

NumericSearchConstraint nsConstraint = null;

int value = 30000;

nsConstraint = new NumericSearchConstraint(value,NumericSearchConstraint.EQUALS);

search.addSearchItem(numDim1,nsConstraint);

Is there something that I am missing?

Regards

Avinash

Accepted Solutions (0)

Answers (1)

Answers (1)

Greg_Austin
Active Participant
0 Kudos

This part seems correct to me assuming the TableId and FieldId are set correctly.

Can you give the error you are seeing and the rest of the search code like creating the ResultDefinition and the execution of the search command?

Former Member
0 Kudos

Well the strange part is that the Result Definition and execution of search commands with other constraint (like not null) is working fine.

I can only explain you the situation in statement

i am executing the limitingsearch command in a try block.

in the catch block of CommandException, i am catching the exception object and displaying the message.

But at runtime what actually happens is I see an error page (which should not have come as I am using catch).

This error line that is given in the error page is this

wdComponentAPI.getMessageManager().reportException(e.toString(),false);

and the exception chain further shows me that some exception in the MessageManager class .

So in this respect there is some problem. It might be in the CommandException whose object I use for displaying the original exception.

Meanwhile since the error is in catch block itself, the original exception is lost.

I hope you get some idea.

Regards

Avinash

Former Member
0 Kudos

The code looks fine. As far as I understood you receive an exception already in catch block. It's pretty strange that your MessageManager gives you an exception but anyway try to put e.printStackTrace(); before the line wdComponentAPI.getMessageManager().reportException(e.toString(),false);

in your catch block and look in the DefaultTrace through the Visual Admin or through the Netweaver Administrator. What is going on there?

Complete source code of the method will be also helpful

Regards

Pavel