class ListToString implements AttributeConverter<List<U>, String> {

    @Override
    public List<U> convertToEntityAttribute(String dbData) {
        try {
            return new Json(dbData).get(getTypeReference());
        } catch (IOException e) {
            throw new IllegalArgumentException("Failed to parse list from Json.", e);
        }
    }

}