Problem wiht Finder Method with Weblogic

Discussions

EJB programming & troubleshooting: Problem wiht Finder Method with Weblogic

  1. Problem wiht Finder Method with Weblogic (2 messages)

    Hi,

    I have written the following in the weblogic-cmp-rdbms-jar.xml file, but it doesn't work but doesn't throw any exception, only do nothing, doesn't do the query right, can anybody help me?

    <finder>
      <method-name>findByName</method-name>
      <method-params>
        <method-param>java.lang.String</method-param>
      </method-params>
      <finder-query>(like name $0%)</finder-query>
    </finder>

    Regards,

    Poli
  2. <finder-query>(like name $0%)</finder-query>

    I am not sure, but I would look at this line here. Doesn't the like comparator automatically look for the name plus the %. meaning names that start with the $0 parameter. You might not need the % there.

    I hope I guessed right

    Mark
  3. Hi, Mark,

    you're right, I don't need %, the correct is:

    <finder-query>(like name $0)</finder-query>

    But in the parameter, it's necessary to add the "%".

    Regards,

    Poli