jboss下如何order by?

03-07-25 AreYouOK?

用JBuilder 8 + JBossOpenTool 2.5 开发CMP

据说JBoss支持order by,请问如何做?

听说要在jbosscmp-jdbc.xml写jboss-ql标签,不过那个文件是自动生成的,怎么做呢?

在ejb-jar.xml中直接使用order by的话出错

org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'select object(o) from Foo o order by o.col1'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "order" at line 1, column 29.

Was expecting one of:

<EOF>

"," ...

)

at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.<init>(JDBCEJBQLQuery.java:46)

at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JDBCCommandFactory.java:53)

at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManager.java:218)