class GlobalAttributeDefinitionDaoHelper {

    public GlobalAttributeDefinitionEntity getGlobalAttributeDefinitionEntity(GlobalAttributeDefinitionKey globalAttributeDefinitionKey)
        throws ObjectNotFoundException
    {
        GlobalAttributeDefinitionEntity globalAttributeDefinitionEntity =
            globalAttributeDefinitionDao.getGlobalAttributeDefinitionByKey(globalAttributeDefinitionKey);

        if (globalAttributeDefinitionEntity == null)
        {
            throw new ObjectNotFoundException(String
                .format("Global attribute definition with level \"%s\" doesn't exist for global attribute definition name \"%s\".",
                    globalAttributeDefinitionKey.getGlobalAttributeDefinitionLevel(), globalAttributeDefinitionKey.getGlobalAttributeDefinitionName()));
        }

        return globalAttributeDefinitionEntity;
    }

}