@Override public BusinessObjectDefinitionTagKeys getBusinessObjectDefinitionTagsByTag(TagKey tagKey) { // Validate the tag key. tagHelper.validateTagKey(tagKey); // Get the tag entity and ensure it exists. TagEntity tagEntity = tagDaoHelper.getTagEntity(tagKey); //Create a list of tag entities along with all its children tags down the hierarchy up to maximum allowed tag nesting level. List<TagEntity> tagEntities = new ArrayList<>(); tagEntities.add(tagEntity); tagEntities.addAll(tagDaoHelper.getTagChildrenEntities(tagEntity)); // Retrieve and return a list of business object definition tag keys. return new BusinessObjectDefinitionTagKeys(businessObjectDefinitionTagDao.getBusinessObjectDefinitionTagsByTagEntities(tagEntities)); }
@Override public BusinessObjectDefinitionTagKeys getBusinessObjectDefinitionTagsByTag(TagKey tagKey) { // Validate the tag key. tagHelper.validateTagKey(tagKey); // Get the tag entity and ensure it exists. TagEntity tagEntity = tagDaoHelper.getTagEntity(tagKey); //Create a list of tag entities along with all its children tags down the hierarchy up to maximum allowed tag nesting level. List<TagEntity> tagEntities = new ArrayList<>(); tagEntities.add(tagEntity); tagEntities.addAll(tagDaoHelper.getTagChildrenEntities(tagEntity)); // Retrieve and return a list of business object definition tag keys. return new BusinessObjectDefinitionTagKeys(businessObjectDefinitionTagDao.getBusinessObjectDefinitionTagsByTagEntities(tagEntities)); }
new BusinessObjectDefinitionTagKey(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME), new TagKey(TAG_TYPE_2, TAG_CODE_2)), new BusinessObjectDefinitionTagKey(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME), new TagKey(TAG_TYPE, TAG_CODE))), businessObjectDefinitionTagDao.getBusinessObjectDefinitionTagsByTagEntities(tagEntities)); assertTrue(businessObjectDefinitionTagDao.getBusinessObjectDefinitionTagsByTagEntities(Arrays.asList(tagEntities.get(2))).isEmpty());