cancel
Showing results for 
Search instead for 
Did you mean: 

MDM 7.1 Java API - Tuple

Former Member
0 Kudos

Hi,

I've a requirement to search (wild card search) a country field. The structure of the MDM table is as following:

1) MDM main table "Customer".

2) "Customer" table has a "Contact Mechanism" tuple and other fields.

3) "Contact Mechanism" has a "Postal Address" tuple and other fields.

4) "Portal Address" has a country lookup field and other fields.

5) Country lookup table has name (eg, United States) and iso code (eg, US).

Now, my application will need to let the user do wild card search, eg, U*, which will return the Customer records which has the country like United States, Uganda, Ukraine, etc.

How to do it with MDM Java API?

Any help would be much appreciated. Thanks.

- julius

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Julus,

The way to do this is as follows:

1) Iteratively retrieve the Field ID's of each field in the path.

i.e. Get the FieldID of "Contact Mechanism" in the Customer table.

Now get the lookup table or tuple which "Contact Mechanism" points to.

Usting this Table/Tuple ID, get the FIeldID of the field "Postal Address".

Now get the lookup table or tuple which Postal Address points to.... etc.

Continue until you have all the FieldID's, and put them into an array.

2) Now populate the Search....


Search mySearch = new Search( Customer_TableID );
SearchDimension sd = new FieldSearchDimension( FieldID[] );  // the array of FieldID's
SearchConstraint sc = new TextSearchConstraint( "U", TextSearchConstraint.STARTS_WITH );
SearchParameter sp = new SearchParameter( sd, sc );
mySearch.addSearchItem( sp );

3) Now go ahead and use mySearch in a RetrieveLiimitedRecordsCommand.

Good luck,

Walter

Former Member
0 Kudos

solved.

nitin_mahajan2
Contributor
0 Kudos

You want to put a logic to eliminate the *s from start/end of the string and use the trimmed string in the search constraint.

Also check if there is a (*) in the start, use the constraint type contains and if it is only at the end, use starts with.

Regards,

Nitin

Answers (0)