Results 1 to 4 of 4

Thread: Exception with OneToMany finder

  1. #1
    Join Date
    Sep 2009
    Posts
    6

    Default Exception with OneToMany finder

    Hi,

    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:

    Code:
    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. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Hi Duncan

    Thanks for the detailed bug report.

    Would you mind please opening a bug ticket at http://jira.springframework.org/browse/ROO 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 https://anonsvn.springframework.org/svn/spring-roo/ 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.

    Thanks!
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  3. #3
    Join Date
    Sep 2009
    Posts
    6

    Default

    Hi Ben,

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

    Thanks

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

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

    Default

    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.

    -Stefan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •