----- Original Message -----
From: "Cedric Beust" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 19, 2001 8:22 PM
Subject: Re: Finder methods


> > From: A mailing list for Enterprise JavaBeans development
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Dominik Drzewiecki
>
> > Lets assume I am using 1.1 CMP Entity Bean.
> > Is it possible to write finder SQL queries for findXXX() methods
> > which rely on joint table data.
>
> Obviously, yes, you can write any SQL queries you want to fetch
information
> from joint tables, but you will need to use BMP if you want to use EJB
1.1.
> On top of that, there is no standardized query language for EJB 1.1 CMP,
so
> your question could only be answered in the context of a specific server.

Yet another assumption: I use Sun's J2EE RI 1.2 or 1.3 Beta server (in 1.1
Entity Bean "compatiility mode"). You write your own finder SQL queries for
beans' finder methods, AFAIK. I don't understand, how other servers would
handle finder methods without using ANY SQL (Please consider, I barely
experienced different servers implementations).

More specifically then, if I used Sun's J2EE RI 1.2 and CMP Entity Beans,
would I be allowed by the container to write SUCH queries for finder
methods?
<sql>SELECT [some fields of B] FROM B, C WHERE B.BID = C.BID AND C.AID =
?</sql>
, where ? stands for well-known ID of A table row.
Is it possible to issue finder SQL queries using various WHERE operators,
apart from only eqality operator (=); I mean: in, between and like?

>
> Should you decide to switch to EJB 2.0, your problem would be solved
> automatically through relationships (whose implementation will typically
> match closely the one you are suggesting with the extra table containing
the
> mapping of foreign keys for the two beans taking part in the
relationship).
Provided that I CAN use SQL queries I asked about, should I switch to EJB
2.0?

>
> If CMP 2.0 relationships are not powerful enough to address your need, you
> can resort to using EJB-QL, which has the merit to be standardized and
> therefore available on any EJB 2.0 compliant server.
>
> --
> Cedric
>


Dominik Drzewiecki

----------------------------------------------------------------------
Dominik Drzewiecki
Student of Computer Science
@ Poznan University of Technology
Poznan, Poland

[EMAIL PROTECTED]
----------------------------------------------------------------------

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to