on 09-16-2009 8:15 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.