Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Tip: how to generate multi-field finders

  1. #11
    Join Date
    Jul 2011
    Posts
    11

    Default

    Great! Andrew. You asked me in another thread - which documentation is priority? I would say what PaoloValladolid asked is a valid question and it would be great if we have documentation on how to enable multiple fields finders across one and multiple domain would be a good start.

  2. #12
    Join Date
    Jul 2011
    Posts
    11

    Default

    Hi Andrew,

    I tried multiple field finder in a single domain - as like you mentioned. This forces me to enter all the search fields. So I tried using Or instead of And between method name, still it forces me to enter all search fields.

    I make required="false" in jspx but still server side is throwing error that fields data is missing (both in case of And and Or)

    Can u pls let me know a solution for this?

    Thanks

  3. #13
    Join Date
    Jul 2011
    Posts
    11

    Default

    I found in aspectJ file Domain_Roo_Finder.aj - the fields are validated for search. How can I edit the file to make the search fields optional. Means only the entered search fields should be part of the SQL query. I also read in a documentation that it is not suggested to modify the aspectJ (I found Roo replacing the modifications in aspectJ).

    How to generate a customized aspectJ or modify an aspectJ(that should not be replaced by Roo)

  4. #14
    Join Date
    May 2006
    Location
    Madrid
    Posts
    382

    Default

    In STS: select the aspect file (.aj), right click -> refactor -> push in... and a wizard will allow you to select the methods that you want to move to (push in) the java file.

    Take care to select all the involved methods and attributes (for instance, in a test, maybe you need to choose a method and the DataOnDemand attribute)

    Press preview to verify and then finish.

  5. #15
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    667

    Default

    Quote Originally Posted by nprabakaran View Post
    I found in aspectJ file Domain_Roo_Finder.aj - the fields are validated for search. How can I edit the file to make the search fields optional. Means only the entered search fields should be part of the SQL query.
    I just noticed that this has already been logged as ROO-2032. Please follow the link and vote for it if you would still like to see it happen.

  6. #16
    Join Date
    Jul 2012
    Posts
    3

    Unhappy How to use coalesce in Roo finders

    Great Stuff....

    I have created finders according to my finding requirements...

    Only thing is I want to add coalesce functionality to some of the Columns of the table...

    How should i do it...?

    I mean Hibernate query should be created like this....
    Code:
    SELECT o.MyColOne,coalesce(o.MyColTwo,'0') FROM MyTable AS o WHERE MyColOne is not null
    Thanks,

    Aditya

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
  •