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?