on 04-02-2014 11:17 AM
Hello,
How do I find out which tables (in data foundation) using object in business layer?
I try open universe business layer (blx) via sdk and get extra tables, but always return empty list.
My code:
public void getMapping() {
SlContext context = null;
IEnterpriseSession enterpriseSession = null;
try {
context = SlContext.create();
enterpriseSession = CrystalEnterprise.getSessionMgr().logon(CMS_LOG_USER, CMS_LOG_PASS, CMS_LOG_HOST, CMS_AUTH_MODE);
context.getService(CmsSessionService.class).setSession(enterpriseSession);
LocalResourceService service = context.getService(LocalResourceService.class);
RelationalBusinessLayer businessLayer = (RelationalBusinessLayer) service.load(BLX_PATH);
RootFolder rootFolder = businessLayer.getRootFolder();
printObjectMapping(rootFolder);
service.close(businessLayer);
} catch (SDKException e) {
System.out.println("Error: " + e.getMessage());
}
}
protected static void printObjectMapping(BlItem biItem) {
if (biItem instanceof BusinessObject) {
BusinessObject elem = (BusinessObject) biItem;
RelationalBinding binding = (RelationalBinding) elem.getBinding();
System.out.println("Object " + elem.getName() + " using tables: " + binding.getExtraTables());
}
if (biItem instanceof BlContainer) {
for (BlItem item : ((BlContainer) biItem).getChildren()) {
printObjectMapping(item);
}
}
}
BO 4.1 SP1
Any ideas?
The getExtraTables() method only gives you the additional tables that have been added to an object manually via the extra tables functionality, not those implicitly referenced it its SQL. If you don't use the "extra tables" functionality in your universe, this list is always empty.
The getImplicitTables(BlItem) method of the BusinessLayerService interface will give you the list of implicit tables.
If you want to know ALL the tables associated with an object -- and you use the "extra tables" functionality in your universe -- you'll want to use both of these methods.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is in the com.sap.sl.sdk.authoring.businesslayer package.
You obtain the service as you do the other SL services, with the SlContext.getService() method:
BusinessLayerService blservice = myContext.getService(BusinessLayerService.class);
Like all the other components of the SL SDK, it is referenced by an entry in the manifest of the all-encompassing sl_sdk.jar. We've split (or hacked) this apart to put the individual components into our maven build and the internal jar is com.sap.sl.sdk.authoring.jar. Not sure how you've configured your build but you should be able to find the class.
Hope this helps.
Hi,
I am getting this error "The query does not reference any table when attempting to build the WHERE clause (IES 00022)" when running the universe created using the semantic layer sdk. After inspection I found that for the columns added in the Business layer there is no associated sql tables assigned.
Is there a way to set implicit table for the fields added in the business layer?
Regards,
Sudheep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I get an exception java.lang.UnsupportedOperationException: csEX
at the line below
RelationalBusinessLayer relBusinessLayer = (RelationalBusinessLayer) localResourceService.load(RET_UNV_PATH);
Please help me on this. Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.