问题
I am getting a look at the Spring Web framework with Roo.
And, I am looking at the vote.roo supplied in the sample directory.
This line called my attention:
finder list --class com.springsource.vote.domain.Vote --depth 2 --filter reg,betw,IpEq
In Spring Roo : what is a dynamic finder ? What does mean this line?
Thanks
回答1:
Roo can be used to generate Finder methods on your Entity classes. In other words, it will create a static method on an Entity that can query the back end for a particular instance of that Entity based on some provided field values.
From the Roo prompt, the finder list command shows you all of the finders that Roo can create for you. The 'depth' option sets the number of fields on that entity that you want to include in the query. So, the line you called out is saying ...
- Show me methods that Roo can create for me on the Vote entity
- Show methods that include two fields
- Only show methods that deal with the "reg", "betw", and "IpEq" fields on the Vote entity.
From there, you can use the finder add command to choose which specific dynamic finder method to create.
来源:https://stackoverflow.com/questions/5224401/in-spring-roo-what-is-a-dynamic-finder