cancel
Showing results for 
Search instead for 
Did you mean: 

MDM API: Is repository schema necessary to search for record

former_member343107
Participant
0 Kudos

Dear all,

I'm using MDM 5.5 SP05.

I need to search for some records. So I need to get the table ID, which is the parameter of the <b>Search</b> class's constructor. In order to get the table ID, I have to use class <b>GetRepositorySchemaCommand</b>, which is based on repository session.

I'm confused. Search operation should only be based on user session, from my perspective. But in the above procedure a repository session is built. Is it necessary or there's any alternative?

Thanks + Best Regards

Jerome

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Jerome,

I'm afraid, you need the code for access to MDM tables.

I suppossed when you say table ID you mean the Code, isn't it?

Usually we add the code as hardcode value (declare constants with table codes and fields codes in DAOs classes).

For example, for to search in table "Vendors":

Search search = new Search(Vendors.Vendor_table_Name);

where Vendors is the DAO class and Vendor_Table_Name is a constant with value "Vendors".

The problem is that you need the same "schema" in all enviornments.

You can see the code through Console Manager.

Hope it helps!

former_member343107
Participant
0 Kudos

Hi Yaiza,

I'm afraid the table ID and table code is not the same. The constructor of Search class is like this:

Search(TableId searchTableId)

So I have to give it an instance of class TableId as parameter. The problem is that at the moment I cannot get the TableId instance without using repository session.

Can you give more detailed information about the usage of DAO class in MDM API? I didn't find the class "Vendors" in MDM Java API document .

Thanks + Best Regards

Jerome

Former Member
0 Kudos

Hi Jerome,

I think you are using Search from com.sap.mdm.search.Search

but I'm using Search from class <b>a2i.search.Search</b>

This class is included in <b>MDM4J.jar</b>.

Im sorry but I can't help you with class com.sap.mdm.search.Search, I've never used it !!

Regards

Former Member
0 Kudos

Hello again,

"Vendors" is a table from my project it was an example. You should use tables from your MDM Repository.

About DAO classes you have to implement them. They should correspond to low level methods that access directly to the table. Coming back to the example, in Vendors DAO class you could define methods like:

getAllvendors();

getVendorById(String vendorId);

getVendorByName(String Name);

...

You can find lot of manuals about building EJB and the VO-DAO arquitecture.

Good luck!!

Answers (0)