Hi everyone, I’m attempting my first java action and would like some advice. I have a filter object with associations to other entities. I want to use the values of these filter associations to filter a list with. Something in line with the following code should work I think: List<Name> names = projects.stream() .filter(p -> p.getYear() == someYear) // keep only projects of a // given year .flatMap(p -> p.getNames().stream()) // get a Stream of all the // Names of all Projects // that passed the filter .collect(Collectors.toList()); // collect to a List However, I need to use values of the associated entity from my filter object. How can this be achieved? Thanks!
You will need to initiate the associated objects to that object with the associations. By calling the appropriate functions like:
Assuming you have an initialized filter object which a Java action provides you by default.
You may then use the attributes from that associated entity. And if you already had everything in system memory this will be the same as a retrieve by association in a microflow, not causing any DB interaction.