-
1. Re: ejbSelectInEntity
dsundstrom Jul 3, 2002 4:00 PM (in response to gchini)> select l
> from l in comComuneSt
> WHERE l.dataIni < ?1 AND
> (l.dataEnd > ?1 OR l.dataEnd IS NULL)
This is not legal EJB-QL. The SELECT and FROM clauses are wrong.
> SELECT OBJECT(l)
> FROM ComComune AS c, IN (c.comComuneSt) As l
> WHERE l.dataIni < ?1 AND
> (l.dataEnd > ?1 OR l.dataEnd IS NULL)
>
> but returns all ComComuneSt related with any
> ComComune, not only with the current
> instance.
EJB-QL queries have no concept of the current instance. If you want only ones for the curent instance you will need to pass in the current instance as a parameter and add something like "AND c = ?2" to the WHERE clause. When passing in the parameter make sure not to pass just "this" you need either the remote interface or the local interface which you can get from the EntityContext. Also the type of the parameter must be the remote or local interface you are passing in. -
2. Re: ejbSelectInEntity
gchini Jul 4, 2002 3:43 AM (in response to gchini)Ok, but the Sun EJB Specification version 2.0 page 165 tells about the ejbSelect<METHOD_NAME>InEntity.
But i never saw it in other books. -
3. Re: ejbSelectInEntity
dsundstrom Jul 4, 2002 11:47 AM (in response to gchini)I searched the EJB 2.0 final draft and only found one entry in the Document Revsion History section E.10:
Removed ejbSelectInEntity methods.
I think you may have accidently grabbed an old copy of the specification.