class BusinessObjectDefinitionDescriptionSuggestionDaoHelper {

    public List<BusinessObjectDefinitionDescriptionSuggestionEntity> getBusinessObjectDefinitionDescriptionSuggestionsByBusinessObjectDefinitionAndStatus(
        final BusinessObjectDefinitionKey businessObjectDefinitionKey, final String status)
    {
        // Retrieve the business object definition and ensure it exists.
        BusinessObjectDefinitionEntity businessObjectDefinitionEntity =
            businessObjectDefinitionDao.getBusinessObjectDefinitionByKey(businessObjectDefinitionKey);

        // If the business object definition entity does not exist return an empty list.
        if (businessObjectDefinitionEntity == null)
        {
            return Lists.newArrayList();
        }

        // First get the status entity.
        BusinessObjectDefinitionDescriptionSuggestionStatusEntity businessObjectDefinitionDescriptionSuggestionStatusEntity = null;
        if (StringUtils.isNotBlank(status))
        {
            // Attempt to find the status entity associated with the status string.
            businessObjectDefinitionDescriptionSuggestionStatusEntity =
                businessObjectDefinitionDescriptionSuggestionStatusDao.getBusinessObjectDefinitionDescriptionSuggestionStatusByCode(status);

            // If the status was not found in the status table return an empty list.
            if (businessObjectDefinitionDescriptionSuggestionStatusEntity == null)
            {
                return Lists.newArrayList();
            }
        }

        // The list of business object definition description suggestions.
        List<BusinessObjectDefinitionDescriptionSuggestionEntity> businessObjectDefinitionDescriptionSuggestionEntities =
            businessObjectDefinitionDescriptionSuggestionDao
                .getBusinessObjectDefinitionDescriptionSuggestionsByBusinessObjectDefinitionAndStatus(businessObjectDefinitionEntity,
                    businessObjectDefinitionDescriptionSuggestionStatusEntity);

        // If business object definition description suggestion entities do not exist return an empty list.
        if (businessObjectDefinitionDescriptionSuggestionEntities == null)
        {
            return Lists.newArrayList();
        }

        return businessObjectDefinitionDescriptionSuggestionEntities;
    }

}