-
Feb 24th, 2010, 08:27 AM
#1
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.
-
Feb 24th, 2010, 12:08 PM
#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
-
Feb 25th, 2010, 05:20 AM
#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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules