Results 1 to 3 of 3

Thread: How to access finder method in controller explicitly

  1. #1
    Join Date
    Oct 2010
    Posts
    2

    Default 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. #2
    Join Date
    Nov 2009
    Location
    Montreal, Quebec
    Posts
    398

    Default

    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();

  3. #3
    Join Date
    Oct 2010
    Posts
    2

    Default

    Hi pgrimard

    Thanks for immediate response. That works.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •