Announcement Announcement Module
Collapse
No announcement yet.
How to access finder method in controller explicitly Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to access finder method in controller explicitly

    I have added finder method to an entity class, and could access via dynamically round tripped views. However I want to access finder methods explicitly from controller or any other classes. Is this possible ?

    For example, I have created new controller as homeController, that would be called on landing on web application, I want to load all products using a finder method and display them (on landing page)

    If not possible, any alternate solution would be appreciated with roo.

  • #2
    The finder methods are static methods, so the simplest form would be to call the finder method from your controller like so:

    Code:
    List<MyObject> list = MyObject.findAllMyObjects();

    Comment


    • #3
      Hi pgrimard

      Thanks for immediate response. That works.

      Comment

      Working...
      X