You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Kaeto23 <ka...@yahoo.de> on 2006/10/25 14:20:54 UTC

ejbSelect with LIMIT

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Hello,

the main ejbSelect problems are resolved. Now there's another problem
which may not be related to a bug but to a missunderstanding.

Have this ejbSelect:

@XD5EjbSelectMethode(descr="returns the latest post from the forum",
ejbQL="select distinct object(p) from Post as p where
p.thread.forum.id=?1 order by p.erstellt desc limit 1")
public abstract Post ejbSelectLatestPost(long forumId) throws
FinderException;

which should return the latest post entry from a forum. Unfortunately
the TranQL parser thinks that this ejbQL is wrong. Does anyone have the
correct syntax for this?

Stacktrace at deploy time:

aused by: org.tranql.ql.QueryException: Select [Select
method=[ejbSelectLatestPost]; EJB-QL=[select distinct object(p) from
Post as p where p.thread.forum.id=?1 order by p.erstellt desc limit 1]]
	at
org.tranql.sql.EJBQLToPhysicalQuery.buildSelect(EJBQLToPhysicalQuery.java:173)
	at
org.tranql.sql.EJBQLToPhysicalQuery.buildSelects(EJBQLToPhysicalQuery.java:109)
	... 37 more
Caused by: org.tranql.ql.QueryException: Parser, lexer or Tree-walker
exception
	at
org.tranql.sql.EJBQLToPhysicalQuery.getEJBQLQuery(EJBQLToPhysicalQuery.java:235)
	at
org.tranql.sql.EJBQLToPhysicalQuery.buildSelect(EJBQLToPhysicalQuery.java:152)
	... 38 more
Caused by: org.tranql.ql.QueryException: Tokens left on the stream.
	at
org.tranql.sql.EJBQLToPhysicalQuery.getEJBQLQuery(EJBQLToPhysicalQuery.java:227)
	... 39 more

Best regards

Dirk

- --
Kaeto23

HTTP: http://kaeto23.dnsalias.com (german!)
Jabber: jabber://kaeto23@jabber.ds2/DS2

Reclaim Your Inbox!
http://www.mozilla.org/products/thunderbird/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFP1ambiSTaBU+G6oRA/eWAJ4p8YmkVBWVlOOaW+3nDw3QgO6SnwCfVF0G
ZijW675K1JD/WS2ihWIJBHk=
=3pHa
-----END PGP SIGNATURE-----

		
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

Re: ejbSelect with LIMIT

Posted by Kaeto23 <ka...@yahoo.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Hello, Gianny

sad to hear :/ I always thought that it is a standard clause.

Well, you may implement it (the OFFSET clause is also not spec
compliant?) but you don't need to. I'll try to create workaround in that
case :)

Best regards

Dirk

Gianny Damour schrieb:
> Hello,
> 
> The LIMIT clause is not an EJBQL standard compliant clause and TranQL
> does not support it. Thought, I should be able to add it rather easily.
> 
> Thanks,
> Gianny
> 
> On 25/10/2006, at 10:20 PM, Kaeto23 wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: RIPEMD160
>>
>> Hello,
>>
>> the main ejbSelect problems are resolved. Now there's another problem
>> which may not be related to a bug but to a missunderstanding.
>>
>> Have this ejbSelect:
>>
>> @XD5EjbSelectMethode(descr="returns the latest post from the forum",
>> ejbQL="select distinct object(p) from Post as p where
>> p.thread.forum.id=?1 order by p.erstellt desc limit 1")
>> public abstract Post ejbSelectLatestPost(long forumId) throws
>> FinderException;
>>
>> which should return the latest post entry from a forum. Unfortunately
>> the TranQL parser thinks that this ejbQL is wrong. Does anyone have the
>> correct syntax for this?
> 
> 

- --
Kaeto23

HTTP: http://kaeto23.dnsalias.com (german!)
Jabber: jabber://kaeto23@jabber.ds2/DS2

Reclaim Your Inbox!
http://www.mozilla.org/products/thunderbird/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFP1vNbiSTaBU+G6oRA8DTAJ9+CCyEwLk4GkWEFvb8UXxn5pZrLwCgifDx
Gp/uHeGEc2yv6+gIox6BNUc=
=1fbY
-----END PGP SIGNATURE-----

	

	
		
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de

Re: ejbSelect with LIMIT

Posted by Gianny Damour <gi...@optusnet.com.au>.
Hello,

The LIMIT clause is not an EJBQL standard compliant clause and TranQL  
does not support it. Thought, I should be able to add it rather easily.

Thanks,
Gianny

On 25/10/2006, at 10:20 PM, Kaeto23 wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>
> Hello,
>
> the main ejbSelect problems are resolved. Now there's another problem
> which may not be related to a bug but to a missunderstanding.
>
> Have this ejbSelect:
>
> @XD5EjbSelectMethode(descr="returns the latest post from the forum",
> ejbQL="select distinct object(p) from Post as p where
> p.thread.forum.id=?1 order by p.erstellt desc limit 1")
> public abstract Post ejbSelectLatestPost(long forumId) throws
> FinderException;
>
> which should return the latest post entry from a forum. Unfortunately
> the TranQL parser thinks that this ejbQL is wrong. Does anyone have  
> the
> correct syntax for this?