@NamespacePermission(fields="#businessObjectFormatKey.namespace",permissions=NamespacePermissionEnum.WRITE) @Override public BusinessObjectFormat deleteBusinessObjectFormat(BusinessObjectFormatKey businessObjectFormatKey){
  businessObjectFormatHelper.validateBusinessObjectFormatKey(businessObjectFormatKey);
  BusinessObjectFormatEntity businessObjectFormatEntity=businessObjectFormatDaoHelper.getBusinessObjectFormatEntity(businessObjectFormatKey);
  if (businessObjectDataDao.getBusinessObjectDataCount(businessObjectFormatKey) > 0L) {
    throw new IllegalArgumentException(String.format("Can not delete a business object format that has business object data associated with it. Business object format: {%s}",businessObjectFormatHelper.businessObjectFormatEntityAltKeyToString(businessObjectFormatEntity)));
  }
  businessObjectFormatDao.delete(businessObjectFormatEntity);
  if (businessObjectFormatEntity.getLatestVersion()) {
    Integer maxBusinessObjectFormatVersion=businessObjectFormatDao.getBusinessObjectFormatMaxVersion(businessObjectFormatKey);
    if (maxBusinessObjectFormatVersion != null) {
      BusinessObjectFormatEntity previousVersionBusinessObjectFormatEntity=businessObjectFormatDao.getBusinessObjectFormatByAltKey(new BusinessObjectFormatKey(businessObjectFormatKey.getNamespace(),businessObjectFormatKey.getBusinessObjectDefinitionName(),businessObjectFormatKey.getBusinessObjectFormatUsage(),businessObjectFormatKey.getBusinessObjectFormatFileType(),maxBusinessObjectFormatVersion));
      previousVersionBusinessObjectFormatEntity.setLatestVersion(true);
      businessObjectFormatDao.saveAndRefresh(previousVersionBusinessObjectFormatEntity);
    }
  }
  return businessObjectFormatHelper.createBusinessObjectFormatFromEntity(businessObjectFormatEntity);
}

@ NamespacePermission ( fields = "#businessObjectFormatKey.namespace" , permissions = NamespacePermissionEnum . WRITE ) @ Override public BusinessObjectFormat deleteBusinessObjectFormat ( BusinessObjectFormatKey businessObjectFormatKey ) { businessObjectFormatHelper . validateBusinessObjectFormatKey ( businessObjectFormatKey ) ; BusinessObjectFormatEntity businessObjectFormatEntity = businessObjectFormatDaoHelper . getBusinessObjectFormatEntity ( businessObjectFormatKey ) ; if ( businessObjectDataDao . getBusinessObjectDataCount ( businessObjectFormatKey ) > 0L ) { throw new IllegalArgumentException ( String . format ( "Can not delete a business object format that has business object data associated with it. Business object format: {%s}" , businessObjectFormatHelper . businessObjectFormatEntityAltKeyToString ( businessObjectFormatEntity ) ) ) ; } businessObjectFormatDao . delete ( businessObjectFormatEntity ) ; if ( businessObjectFormatEntity . getLatestVersion ( ) ) { Integer maxBusinessObjectFormatVersion = businessObjectFormatDao . getBusinessObjectFormatMaxVersion ( businessObjectFormatKey ) ; if ( maxBusinessObjectFormatVersion != null ) { BusinessObjectFormatEntity previousVersionBusinessObjectFormatEntity = businessObjectFormatDao . getBusinessObjectFormatByAltKey ( new BusinessObjectFormatKey ( businessObjectFormatKey . getNamespace ( ) , businessObjectFormatKey . getBusinessObjectDefinitionName ( ) , businessObjectFormatKey . getBusinessObjectFormatUsage ( ) , businessObjectFormatKey . getBusinessObjectFormatFileType ( ) , maxBusinessObjectFormatVersion ) ) ; previousVersionBusinessObjectFormatEntity . setLatestVersion ( true ) ; businessObjectFormatDao . saveAndRefresh ( previousVersionBusinessObjectFormatEntity ) ; } } return businessObjectFormatHelper . createBusinessObjectFormatFromEntity ( businessObjectFormatEntity ) ; }
deletes a business object format .
