开发者

In Spring Roo : what is a dynamic finder?

I am getting a look at the Spring Web framework with Roo.

And, I am looking at the vote.roo supplied in the sample direct开发者_如何学Cory.

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


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 ...

  1. Show me methods that Roo can create for me on the Vote entity
  2. Show methods that include two fields
  3. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜