Results 1 to 5 of 5

Thread: Dynamic finder scaffolding with blank fields

  1. #1
    Join Date
    Jun 2010
    Location
    Galicia, Spain
    Posts
    2

    Question Dynamic finder scaffolding with blank fields

    Hi

    I'm trying Spring Roo and trying the dynamic finders functionality..

    At first it looks like a very promising feature, to be able to create search methods with a few parameters based on the method name just using some convention but the way it works feels somehow surprising

    for example, when you create a dynamic finder, lets say "findPizzasByNameLikeAndDescriptionLike", the scaffolded functionality you get treats both fields as required throwing an exception if they are not filled up, and they are treated as required even if the finder user and OR instead of And..

    So you can not search just by name or just by description leaving the other field empty so it's not taken into account on the search results

    I think that what most users would expect when they use a search form with a few fields, is that they can fill up some of them and leave the ones that they donīt want to include in the search

    As it is right now, I find hardly useful this functionality , even if you push in the "findPizzasByNameLikeAndDescriptionLike" into the PizzaController and replace blanks with asterisks so you can get it as most users would expect it to work, you will get the hql/sql making comparisons in all the columns which would be at beast unnecessary..


    It's there any plan to improve this or to create a search functionality that would provide some form of filtering?

    Regards and thanks for the effort put in Roo
    Ivan

  2. #2
    Join Date
    Sep 2010
    Posts
    5

    Default Dynamic finder with required/ optional fields

    I too have the same requirement. I used the Or clause for the dynamic finder for eg: findPeopleByDateOfBirthBetweenOrLocationLikeOrAge

    I expect that only few fields will be entered by the user. But the generated code requires that all the fields are mandatory. Is there some roo way to specify that the some of the fields are optional?
    Please address the issue

    And Ya, Excellent effort with Roo. Kudos to the development team.

    Regards,
    Ratish

  3. #3
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    Indeed, currently all finder generated search fields are mandatory which does make sense for AND combinations but less so for OR combinations as mentioned above.

    Please feel free to open a Jira improvement ticket so I can take a look.

    In the meantime, you always have the opportunity to change things as needed in your code.
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

  4. #4
    Join Date
    Sep 2010
    Posts
    5

    Default

    Hi Stefan,
    Thanks for your reply.

    Will make changes in my code to accommodate my requirement.

    Ratish

  5. #5
    Join Date
    Nov 2010
    Posts
    5

    Default Jira Entry

    Created a Jira entry for the same, as I couldn't find one.
    https://jira.springframework.org/browse/ROO-1804

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
  •