<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.6000.16735" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#c7edcc>
<DIV><FONT face=Arial size=2>JBoss-4.2.3.GA / Eclipse 3.4 with JBoss Tools
2.12.GA / PostgresQL 8.1 / JDK 1.6</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I want using Limit in my JPQL subquery :
</FONT></DIV>
<DIV><FONT face=Arial size=2> "select questions "
+<BR> "from Question questions "
+<BR> "where questions in ( SELECT questions
" + <BR> "FROM questions "
+<BR> "WHERE questions.typeBean.typeId IN (
:typeId ) " +<BR> "AND
questions.questionTypeBean.questionTypeId IN ( :questionTypeId ) "
+<BR> "ORDER BY random() Limit ( :limit
) ) " +<BR> "ORDER BY
questions.questionFlag "</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>"random()" can be used, but "Limit" is
useless, and I found org.jboss.ejb.plugins.cmp.ejbql.ASTLimitOffset at
jboss.jar, how could I using "Limit" ? And, is "random()" is supported by jboss
or other one ?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Best regards,<BR> <BR>Zhang
ZeHao<BR></FONT></DIV></BODY></HTML>