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> FROM ... like statements. will dynamic query feature allow above statement? Thx
phani
** ** ** **


On 2/23/06, *Gianny Damour* <[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