Very cool. I haven't been following JPA (EJB3 Persistence) that closely, so I'm curious how closely this matches up what's coming in EJB3.

-dain

On Mar 2, 2006, at 4:02 AM, Gianny Damour wrote:

Hi Phani,

Sorry for this late reply - I was focused on completing the implementation of dynamic queries, which is now available in trunk.

ModuleCMPEngine is not DayTrader specific. Basically, the idea it to bind a specific GBean to the ENC of the component from which you need to perform the dynamic query. "ModuleCmpEngine" is the j2eeType of the GBean to be bound; its type is "org.openejb.entity.cmp.ModuleCmpEngine"; its J2EE module type is "EJBModule"; its name is "moduleCmpEngine" and it is part of the EJB module defining the CMP for which you need to execute dynamic EJBQL queries. So, to bind it to the ENC you use something like this:

          <gbean-ref>
              <ref-name>cmp/QueryManager</ref-name>  -- ENC name
              <ref-type>ModuleCmpEngine</ref-type> -- j2eeType
<proxy-type>org.openejb.entity.cmp.ModuleCmpEngine</ proxy-type> -- GBean type
              <gbean-locator>
<module>name_of_the_ejb_module</module> -- name of the EJB module
                  <type>EJBModule</type> -- J2EE module type
                  <name>moduleCmpEngine</name> -- name of the GBean
              </gbean-locator>
          </gbean-ref>

Thanks,
Gianny

Phani Madgula wrote:

Hi Gianny,
 Thanks for info.
 I understand following from the Query engine.
1. As a first step, we will have a query engine that allows only standard EJB-QL. No additional capabilities. 2. From the tags mentioned in your previous mail, ModuleCMPEngine will be part of DayTrader application? My question is, where is ModuleCMPEngine located?
   Thx
phani


On 2/27/06, *Gianny Damour* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hi Phani,

    In a first step, we will add support for standard EJBQL
    statements. The
    current impl. is as follows:

* in the vendor specific deployment descriptor, a specific GBean is
    bound to the ENC. This looks like this:
               <gbean-ref>
                   <ref-name>cmp/QueryManager</ref-name>
                   <ref-type>ModuleCmpEngine</ref-type>
                   <gbean-locator>

<application>geronimo/daytrader-derby-jetty/1.1-SNAPSHOT/car</ application> <module> daytrader-ejb-1.1-SNAPSHOT.jar</ module>
                       <type>EJBModule</type>
                       <name>moduleCmpEngine</name>
                   </gbean-locator>
               </gbean-ref>

* from the J2EE component having the above gbean-ref, we following
    snippet retrieves a QueryManager:
       QueryManagerLocator locator = new QueryManagerLocator();
       QueryManager qm = locator.locate("cmp/QueryManager");

    * the QueryManager allows the creation of queries:
       Query query = qm.createQuery("select H from HoldingEJB H where
    H.holdingID = ?", new Class[] {Integer.class});

    * parameters are then set:
       query.setParameter(0, new Integer(1));

* when the parameters have been set, the query is then executed and
    return the result as a single object or a list:
       Object result = query.getSingleResult();
    or
       List results = query.getResultList();

I am in the process of testing the impl.; meanwhile, if you think that
    the above can be improved, then let us know.

    Thanks,
    Gianny


    Phani Madgula wrote:

    > Hi Gianny,
    >
    > I just want to know more about this feature.
    >
> Is it something like AG providing an API for CMP clients to execute
    > EJBQL statements at runtime?.
    >
> If yes, what kind of queries we can execute? are query capabilities
    > extended?
    >
> For example, currently EJB-QL does not allow multiple expressions in
    > SELECT class.
    > That is, we can't have SELECT OBJECT(e), e.name <http://e.name>
    < http://e.name> FROM
    > ... like statements.
    >
    > will dynamic query feature allow above statement?
    >
    > Thx
    > phani
    >
    >
    >
    > **
    > **
    > **
    >
    > **
    >
    >
    >
    >
    > On 2/23/06, *Gianny Damour* <[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
    > <mailto: [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>>> wrote:
    >
    >     Hi Glaucio,
    >
    >     It is not yet possible to create dynamic queries in
    Geronimo. This
    >     feature is currently being progressed and will be available
    next
    >     week.
    >
    >     Thanks,
    >     Gianny
    >
    >     Glaucio Scheibel wrote:
    >
    >     > Hi,
    >     >
> > I am looking how to create dynamic queries in geronimo. Is
    this
    >     > possible? I didn't find any info about this.
    >     >
    >     > Thanks in advance
    >     > Glaucio
    >     >
    >     >
    >
    >
    >





Reply via email to