2 Replies Latest reply on May 24, 2002 1:09 PM by Ryan Ramage

    Object[] as method-params

    George Chitishvili Newbie

      Hi all,

      Can I use some array or Vector as the parameter for finder-query and then use it in IN-operator?


        • 1. Re: Object[] as method-params
          Dain Sundstrom Master

          No, but you can dynamically generate a JBossQL statement using the Vector. Take a look at the JBossOne-JBossCMP slides that are available on the JBoss project page on source forge. Watch out for the typo in the jbosscmp-jdbc.xml sample; it has declared-sql when it should be dynamic-ql.

          • 2. Re: Object[] as method-params
            Ryan Ramage Newbie

            I have tried this way of doing a dynamic sized array at runtime. The problem is that the IN operator is not working like I thought it would.

            This Query returns results:
            SELECT OBJECT(l) FROM RealEstateListing l WHERE l.area IN ('A410')

            This Query does not return results (which it should):
            SELECT OBJECT(l) FROM RealEstateListing l WHERE l.area IN ('A408','A410')

            Either I am not undersatnding how the IN operator works, or there is a bug in the parser. Any ideas?

            I am using jboss 3.0 RC2.