Whoops, I totally misunderstood your question (obviously). The spec says that EJB-QL operates on "abstract schema types." I would imagine that, for DVCs (which is what we're talking about here, right?) the abstract schema type is just "Object." I don't see anything in the spec which contradicts it, and it does explicitly say that Serializeable dependant value classes can be CMP-fields.

Dave



[EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]

06/05/2003 10:36 AM
Please respond to jboss-user

       
        To:        [EMAIL PROTECTED]
        cc:        
        Subject:        Re: [JBoss-user] EJB-QL Finder and POJO




It's not allowed as a "finder" (if you mean a method named findXXX in the bean Home class), but it's valid EJB-QL if its in a select method ("private" method -- see note below -- called ejbSelectXXX in the bean class, that's called from a business method -- i.e. getSomeFieldBasedOnQuery()).


Finders, according the the spec, must return the Bean type from whose Home they're called.


Hope that helps,


Dave


PS -- the relevant parts of the spec:


"The entity bean class may define one or more select methods whose signatures must follow the following

rules:

The method name must have ejbSelect as its prefix.

The method must be declared as public.

The method must be declared as abstract.

The throws clause must define the javax.ejb.FinderException. The throws clause may define

arbitrary application specific exceptions."


Note they are declared as public so the container can call/intercept them, whatever, but they do *not* show up in the interface classes, so from the client and bean programmer view, they're "private" methods.



"Rupp,Heiko" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]

06/05/2003 05:59 AM
Please respond to jboss-user

       
       To:        "JBoss Users (E-Mail)" <[EMAIL PROTECTED]>

       cc:        

       Subject:        [JBoss-user] EJB-QL Finder and POJO




Hi,

I am a bit confused and did not find the answer in the
EJB spec:

Is the following finder allowed in EJB-QL or not?
<query>
<query-method>
 <method-name>findPojo</method-name>
 <method-params>
  <method-param>com.acme.POJO</method-param>
 </method-params>
</query-method>
<ejb-ql>
  <![CDATA[SELECT Object(o) from EntityOne o WHERE o.pojo=?1]]>
</ejb-ql>
</query>

With POJO just being a pojo that implements Serializable

What are the allowed data types for queries? Primitive types (int, ..)
java.lang.{String, Integer,...} and?

Does anyone have the part in the spec handy that clarifies this?

Thanks
Heiko

--
Bancotec GmbH      EMail: [EMAIL PROTECTED]
Calwer Str. 33     Telefon: +49 711 222 992 900
D-70173 Stuttgart  Telefax: +49 711 222 992 999
Ein Unternehmen der Cellent AG http://www.cellent.de/


-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Reply via email to