ComboboxValueService

public interface ComboboxValueService

This service is responsible for retrieving all possible values for comboboxes. This is useful with comboboxes that take user supplied values, since the total number of selections depends on what the users has entered. Instead of updating the data on each instance save, this service will retrieve the values from the database at read time using a distinct query. This service lives in the entities bundle, since it needs access to entity classes.

Methods

getAllValuesForCombobox

List<String> getAllValuesForCombobox(String entityClassName, String fieldName)

Retrieves all values for a combobox. For string comboboxes a DISTINCT query on the instances will be performed. For comboboxes that are enums, only their settings will used.

Parameters:
  • entityClassName – the class name of the entity that contains the combobox field
  • fieldName – the name of the combobox field
Returns:

all values for the combobox, as a list of strings

getAllValuesForCombobox

List<String> getAllValuesForCombobox(EntityDto entityDto, FieldDto fieldDto)

Retrieves all values for a combobox. For string comboboxes a DISTINCT query on the instances will be performed. For comboboxes that are enums, only their settings will used.

Parameters:
  • entityDto – the entity to which the combobox field belongs to
  • fieldDto – the combobox field
Returns:

all values for the combobox, as a list of strings