@NamespacePermission(fields="#request.namespace",permissions=NamespacePermissionEnum.WRITE) @Override public BusinessObjectDefinition createBusinessObjectDefinition(BusinessObjectDefinitionCreateRequest request){
  validateBusinessObjectDefinitionCreateRequest(request);
  NamespaceEntity namespaceEntity=namespaceDaoHelper.getNamespaceEntity(request.getNamespace());
  DataProviderEntity dataProviderEntity=dataProviderDaoHelper.getDataProviderEntity(request.getDataProviderName());
  BusinessObjectDefinitionKey businessObjectDefinitionKey=new BusinessObjectDefinitionKey(request.getNamespace(),request.getBusinessObjectDefinitionName());
  BusinessObjectDefinitionEntity businessObjectDefinitionEntity=businessObjectDefinitionDao.getBusinessObjectDefinitionByKey(businessObjectDefinitionKey);
  if (businessObjectDefinitionEntity != null) {
    throw new AlreadyExistsException(String.format("Unable to create business object definition with name \"%s\" because it already exists for namespace \"%s\".",businessObjectDefinitionKey.getBusinessObjectDefinitionName(),businessObjectDefinitionKey.getNamespace()));
  }
  businessObjectDefinitionEntity=createBusinessObjectDefinitionEntity(request,namespaceEntity,dataProviderEntity);
  return createBusinessObjectDefinitionFromEntity(businessObjectDefinitionEntity);
}

@ NamespacePermission ( fields = "#request.namespace" , permissions = NamespacePermissionEnum . WRITE ) @ Override public BusinessObjectDefinition createBusinessObjectDefinition ( BusinessObjectDefinitionCreateRequest request ) { validateBusinessObjectDefinitionCreateRequest ( request ) ; NamespaceEntity namespaceEntity = namespaceDaoHelper . getNamespaceEntity ( request . getNamespace ( ) ) ; DataProviderEntity dataProviderEntity = dataProviderDaoHelper . getDataProviderEntity ( request . getDataProviderName ( ) ) ; BusinessObjectDefinitionKey businessObjectDefinitionKey = new BusinessObjectDefinitionKey ( request . getNamespace ( ) , request . getBusinessObjectDefinitionName ( ) ) ; BusinessObjectDefinitionEntity businessObjectDefinitionEntity = businessObjectDefinitionDao . getBusinessObjectDefinitionByKey ( businessObjectDefinitionKey ) ; if ( businessObjectDefinitionEntity != null ) { throw new AlreadyExistsException ( String . format ( "Unable to create business object definition with name \"%s\" because it already exists for namespace \"%s\"." , businessObjectDefinitionKey . getBusinessObjectDefinitionName ( ) , businessObjectDefinitionKey . getNamespace ( ) ) ) ; } businessObjectDefinitionEntity = createBusinessObjectDefinitionEntity ( request , namespaceEntity , dataProviderEntity ) ; return createBusinessObjectDefinitionFromEntity ( businessObjectDefinitionEntity ) ; }
creates a new business object definition .
