In Spring Roo : what is a dynamic finder?

冷暖自知 提交于 2019-12-22 06:16:09

问题


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

  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.



来源:https://stackoverflow.com/questions/5224401/in-spring-roo-what-is-a-dynamic-finder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!