Announcement Announcement Module
No announcement yet.
Exception with OneToMany finder Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception with OneToMany finder


    I love Roo, but there is one area I think needs urgent attention before GA:

    If we take the simple example of Pizzas with Toppings and make the roo script below:

    create project -topLevelPackage com.pizzas
    install jpa -provider OPENJPA -database HYPERSONIC_PERSISTENT
    new persistent class jpa -name ~.domain.Topping
    add field string -fieldName name
    new persistent class jpa -name ~.domain.Pizza
    add field string -fieldName name
    add field set jpa -element ~.domain.Topping -fieldName toppings
    install finder -class ~.domain.Pizza -finderName findPizzasByToppings
    new controller automatic -name ~.web.ToppingController -formBackingObject ~.domain.Topping
    new controller automatic -name ~.web.PizzaController -formBackingObject ~.domain.Pizza
    Then start and visit the resulting app with your browser on : http://localhost:8080/pizzas/

    Try to use the finder on Pizza to locate a Pizza by Toppings.
    You will just see a text box, surely there should be a selectable list of toppings?
    After some playing it seems the box wants a long relating to the ID of the topping, but there seems no way to specifiy more than one topping. If you do specify a single valid topping ID you get a classcast exception.

    Also, while we are here the Menu text is wrong , it says: "Find by find by Toppings".

    Roo is great keep up the great work Ben and Stefan etc.

    Would be very grateful for some pointers on how to overcome this.

    Duncan. (using 1.0.0.RC2 [rev 274] , and OPENJPA due to problems with Hibernate - try that too)

  • #2
    Hi Duncan

    Thanks for the detailed bug report.

    Would you mind please opening a bug ticket at and we will investigate it for you right away.

    Also, if you have a moment, please feel free to try the latest trunk version of Roo. You can checkout Roo from and perform a build easily using Maven (please see the readme.txt in the root of the checkout directory). I know Stefan has made a large number of enhancements to Roo's web support since 1.0.0.RC1 was officially released, so it'd be good if this issue has already been addressed. We're also happy to test it with trunk if you'd be able to just open a bug report.



    • #3
      Hi Ben,

      I was using the latest version of Roo from SVN, build/version 274.
      This is now in JIRA as ROO-221


      Last edited by DuncanD; Sep 28th, 2009, 04:10 AM.


      • #4
        Hi Duncan,

        The use of finders to search by supplying collections was actually not supported by Roo yet. However, I have adjusted the finder add-on (and related add-ons) to handle collections better. This is available as of rev 276 in Roo trunk.

        Please let us know if you encounter any problems.