Howdy,

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.

<More_precisely>
For example there are two tables: A (primary key: AID) and B (primary key:
BID) with many-to-many relationship between those entities, so there is yet
another table, say, C containing references to tables A and B. Now, lets say
I want to find all rows of table B related with specific entry of table A
having known primary key of the A entity. Therefore I would have to issue
following SQL query: <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.

Now, lets assume both A and B tables are mapped to Entity Beans, say ABean
and BBean. I would like to have the finder method in a BBean returning a
collection of BBean instances related with the particular ABean data - in
other words is it possible to write following finder method
<finder_method>Collection findAllBeezRelatedWithA(int AID);</finder_method>
which would be supported (at deployment time) by SQL query I wrote above;
</More_precisely>

TIA,
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