Announcement Announcement Module
Collapse
No announcement yet.
Why finders return Query Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why finders return Query

    Hi,

    what was the reason for the finders generated using say:

    finder add --finderName findUsersByCode --class foo.bar.User

    to return a Query rather than a list of User - List<User>

    I dont want to use the Web part of ROO and so the Query object returned from the finder is exposed and coupled to my Service/Dispacher/Facade tier. There must be a reason for doing this, just cannot think of why.

  • #2
    We return the query object for convenience reasons. For example you may want to paginate over the result or add further attributes to the query which you would not otherwise be able to do.

    HTH,
    Stefan

    Comment


    • #3
      Hi Stefan

      I guess this makes things more flexible, but it also potentially introduces persistance code into my service or web tier.

      Infact, because Im working with my entities in a generic way, I've created a DAO to encapsulate my "extra" persistence logic. Not very ROO like I know but atleast my Query isnt going to be exposed.

      Thanks for the feedback

      Tim

      Comment

      Working...
      X