EJBQL method-param question

Discussions

EJB programming & troubleshooting: EJBQL method-param question

  1. EJBQL method-param question (3 messages)

    I have get two questions about ejbql ,

    1)can I use Object Array as my method param?!
    for example
    <method-params>
    <method-param>java.lang.Object[]</method-param>
    </method-params>
    and then call it like this: <ejb-ql>select object(o) from Pecnctemp o where o.key == ?1[0]</ejb-ql>

    2) can I use HashMap as my method param?!
    for example
    <method-params>
    <method-param>java.lang.HashMap</method-param>
    </method-params>
    and then call it like this: <ejb-ql>select object(o) from Pecnctemp o where o.key == ?1.get("key")</ejb-ql>
    ?

    Thanks

    Threaded Messages (3)

  2. EJBQL method-param question[ Go to top ]

    In theory there is nothing wrong with this (the EJB specs don't prohibit it). In practice, all the EJB servers I have worked with only support datatypes with straightforward JDBC mappings: Strings, Dates, primitives and primitive object wrappers.
  3. EJBQL method-param question[ Go to top ]

    I have seen that using Object arrays is possible in JBoss with DynamicQL which is like EJB-QL with some new features added by the JBoss engineers. I haven't used it but I have seen some examples which use object arrays as parameters.
  4. WAS[ Go to top ]

    actually I am using WebSphere 5 , in there is Array checkbox in the EJBQL wizard and I would love to see an example of a working query...