Hi,

Is it possible to have a finder that uses the relation table in an M:N relationship ?

The tables i use are :

table Task :
*IdTask
Subject
Comments
StartDate
EndDate

table Person
*IdPerson
Name
Surname

the relationtable is as follow :

table TaskToPerson
*Id
IdPerson
idTask


Here is the query I have implemented but it fails at the beans' start.


* signature="java.util.Collection findByOwnerAndDate(java.lang.Integer anId, java.lang.String aDate)"
* query="SELECT DISTINCT OBJECT(t)
FROM ejbTask t
WHERE t.persons = anId AND
t.StartDate BETWEEN aDate AND aDate
AND t.EndDate BETWEEN aDate AND aDate
ORDER BY t.StartDate"
* result-type-mapping="Local"



The "persons" field is the one which is used for the relationship.
As it is a Collection, I have also tried to do "anId IN t.persons" instead of "t.persons = anId"



Both aren't working.
Notice that it has been implemented as a Jboss-QL query (because of the ORDER BY clause)


thanks for your help,
ionel




-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to