jboss 3.x里的ejb-ql出错

03-05-13 xygaoz

偶初学ejb,在一个cmp的finder的ejb-ql如下:
SELECT OBJECT(p) FROM Users AS p WHERE p.status > ?1
编译部署在jboss 3.2里,出现如下错误:
2003-05-13 00:07:33,428 ERROR [org.jboss.ejb.EntityContainer] Starting failed
org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(p) FROM Users AS p WHERE p.status > ?1'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "p.status" at line 1, column 42.
Was expecting one of:
"NOT" ...
"(" ...
<COLLECTION_VALUED_PATH> ...
<STRING_VALUED_PATH> ...
"CONCAT" ...
"SUBSTRING" ...
<BOOLEAN_VALUED_PATH> ...
<DATETIME_VALUED_PATH> ...
<ENTITY_VALUED_PATH> ...
<IDENTIFICATION_VARIABLE> ...
<NUMERIC_VALUED_PATH> ...
"LENGTH" ...
"LOCATE" ...
"ABS" ...
"SQRT" ...
"+" ...
"-" ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
<NUMERIC_VALUED_PARAMETER> ...
)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.<init>(JDBCEJBQLQuery.java:46)
……略

p.status映射表的status字段,类型是number,数据库是oracle 8i,偶再试了
SELECT OBJECT(p) FROM Users AS p WHERE p.status = ?1
SELECT OBJECT(p) FROM Users AS p WHERE p.status BETWEEN ?1 AND ?2
都是这样的错误,如果字段是字符型的话则不会出错,这是jboss的bug?

另外,网上有资料说,EJB QL不支持Like声明参数,例如
SELECT DISTINCT OBJECT(user)
FROM User user
WHERE user.userInfo.lastName LIKE ?1
我试了一下,jboss里的确也是出错。
类试的方法是什么?最好给出代码,万分感谢!