Announcement Announcement Module
Collapse
No announcement yet.
Dynamic finder scaffolding with blank fields Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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.

      Comment


      • #4
        Hi Stefan,
        Thanks for your reply.

        Will make changes in my code to accommodate my requirement.

        Ratish

        Comment


        • #5
          Jira Entry

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

          Comment

          Working...
          X