@NamespacePermission(fields="#request.namespace",permissions=NamespacePermissionEnum.WRITE) @Override public BusinessObjectFormat createBusinessObjectFormat(BusinessObjectFormatCreateRequest request){
  validateBusinessObjectFormatCreateRequest(request);
  BusinessObjectFormatKey businessObjectFormatKey=getBusinessObjectFormatKey(request);
  BusinessObjectDefinitionEntity businessObjectDefinitionEntity=businessObjectDefinitionDaoHelper.getBusinessObjectDefinitionEntity(new BusinessObjectDefinitionKey(businessObjectFormatKey.getNamespace(),businessObjectFormatKey.getBusinessObjectDefinitionName()));
  FileTypeEntity fileTypeEntity=fileTypeDaoHelper.getFileTypeEntity(request.getBusinessObjectFormatFileType());
  BusinessObjectFormatEntity latestVersionBusinessObjectFormatEntity=businessObjectFormatDao.getBusinessObjectFormatByAltKey(businessObjectFormatKey);
  if (latestVersionBusinessObjectFormatEntity != null) {
    BusinessObjectFormat latestVersionBusinessObjectFormat=businessObjectFormatHelper.createBusinessObjectFormatFromEntity(latestVersionBusinessObjectFormatEntity);
    if (latestVersionBusinessObjectFormat.getSchema() != null) {
      validateNewSchemaIsAdditiveToOldSchema(request.getSchema(),latestVersionBusinessObjectFormat.getSchema());
    }
    latestVersionBusinessObjectFormatEntity.setLatestVersion(false);
    businessObjectFormatDao.saveAndRefresh(latestVersionBusinessObjectFormatEntity);
  }
  Integer businessObjectFormatVersion=latestVersionBusinessObjectFormatEntity == null ? 0 : latestVersionBusinessObjectFormatEntity.getBusinessObjectFormatVersion() + 1;
  BusinessObjectFormatEntity newBusinessObjectFormatEntity=createBusinessObjectFormatEntity(request,businessObjectDefinitionEntity,fileTypeEntity,businessObjectFormatVersion);
  return businessObjectFormatHelper.createBusinessObjectFormatFromEntity(newBusinessObjectFormatEntity);
}

@ NamespacePermission ( fields = "#request.namespace" , permissions = NamespacePermissionEnum . WRITE ) @ Override public BusinessObjectFormat createBusinessObjectFormat ( BusinessObjectFormatCreateRequest request ) { validateBusinessObjectFormatCreateRequest ( request ) ; BusinessObjectFormatKey businessObjectFormatKey = getBusinessObjectFormatKey ( request ) ; BusinessObjectDefinitionEntity businessObjectDefinitionEntity = businessObjectDefinitionDaoHelper . getBusinessObjectDefinitionEntity ( new BusinessObjectDefinitionKey ( businessObjectFormatKey . getNamespace ( ) , businessObjectFormatKey . getBusinessObjectDefinitionName ( ) ) ) ; FileTypeEntity fileTypeEntity = fileTypeDaoHelper . getFileTypeEntity ( request . getBusinessObjectFormatFileType ( ) ) ; BusinessObjectFormatEntity latestVersionBusinessObjectFormatEntity = businessObjectFormatDao . getBusinessObjectFormatByAltKey ( businessObjectFormatKey ) ; if ( latestVersionBusinessObjectFormatEntity != null ) { BusinessObjectFormat latestVersionBusinessObjectFormat = businessObjectFormatHelper . createBusinessObjectFormatFromEntity ( latestVersionBusinessObjectFormatEntity ) ; if ( latestVersionBusinessObjectFormat . getSchema ( ) != null ) { validateNewSchemaIsAdditiveToOldSchema ( request . getSchema ( ) , latestVersionBusinessObjectFormat . getSchema ( ) ) ; } latestVersionBusinessObjectFormatEntity . setLatestVersion ( false ) ; businessObjectFormatDao . saveAndRefresh ( latestVersionBusinessObjectFormatEntity ) ; } Integer businessObjectFormatVersion = latestVersionBusinessObjectFormatEntity == null ? 0 : latestVersionBusinessObjectFormatEntity . getBusinessObjectFormatVersion ( ) + 1 ; BusinessObjectFormatEntity newBusinessObjectFormatEntity = createBusinessObjectFormatEntity ( request , businessObjectDefinitionEntity , fileTypeEntity , businessObjectFormatVersion ) ; return businessObjectFormatHelper . createBusinessObjectFormatFromEntity ( newBusinessObjectFormatEntity ) ; }
creates a new business object format .
