users@glassfish.java.net

what is the behavior of isUserDefined() method in in Query implementation

From: <glassfish_at_javadesktop.org>
Date: Mon, 31 Mar 2008 02:17:19 PST

Hi All,

I'm using a DescriptorEventListener implementation to get the callbacks for an entity class.

In the postBuild callback i want to check if the executed query was a user defined query or created by EntityManager API methods call.

So i tried this:

         public void postBuild(DescriptorEvent event) {
               DatabaseQuery query = event.getQuery();
               if (query != null && query.isUserDefined()) {
                      doSomething();
               } else {
                     doSomethingElse();
               }
         }

But for some user defined queries (NamedQuery, NamedNativeQuery etc), it executes doSomething() whereas for others it executes doSomethingElse().

Can anybody tell me the exact behavior of isUserDefined()??

Thanks & Regards,
Rajbir
[Message sent by forum member 'rajbirb' (rajbirb)]

http://forums.java.net/jive/thread.jspa?messageID=266745