class GlobalAttributeDefinitionDaoHelper {

    public void validateGlobalAttributeDefinitionNoExists(GlobalAttributeDefinitionKey globalAttributeDefinitionKey) throws AlreadyExistsException
    {
        // Validate that the global attribute definition entity does not already exist.
        if (globalAttributeDefinitionDao.getGlobalAttributeDefinitionByKey(globalAttributeDefinitionKey) != null)
        {
            throw new AlreadyExistsException(String.format("Unable to create global attribute definition with global attribute definition level \"%s\" and " +
                    "global attribute definition name \"%s\" because it already exists.",
                globalAttributeDefinitionKey.getGlobalAttributeDefinitionLevel(), globalAttributeDefinitionKey.getGlobalAttributeDefinitionName()));
        }
    }

}