the “finder list” command in Spring-roo, I added the “filter” parameter to cut down the list number of dynamic finder. But that didn’t work for me, it listed the finders which contains “name” OR “price” for me.
finder list --depth 2 --filter name,price
Can anyone tell me how to filter them for only contains “name” AND “price” finders?
i.e.
findBooksByNameNotEqualsAndPrice(String name, Float price)
findBooksByNameEqualsAndPrice(String name, Float price)
……
I checked Roo’s source and it looks like there is no way to obtain the AND like behavior and only OR based logic is supported by the finder add-on.
See the finder addon src here: https://github.com/SpringSource/spring-roo/blob/master/addon-finder/src/main/java/org/springframework/roo/addon/finder/FinderCommands.java#L71.
or the source code right here:
It looks like the list operation adds a filter to the result list every time it finds any required entry in the finder lower case name.
the only way I can think of to filter the list is to copy the output of the finder list command and run an external grep-like utility on it.
Otherwise you could try matching as much of the finders name as possible: something like EqualsAndPrice(String name for example. Ater all a plain java String.contains method is used.