请教一下J道---entitybean的finder方法问题

03-08-31 honor21
请教一下J道:

我在一个entitybean上做了几个finder方法,但奇怪的我做的findAll()方法,编译module时能过,而我的findByUserName()过不了,请大家看看

findAll()的ejbql语句: select object(u) from User u

findByUserName()的ejbql语句: select object(u) from User u where u.userName=?1

报告的异常:

"UserModule.ejbgrpx": ERROR: Error from ejbc: Error while reading 'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was:

"UserModule.ejbgrpx":

"UserModule.ejbgrpx": weblogic.ejb20.cmp.rdbms.finders.IllegalExpressionException:

"UserModule.ejbgrpx": While trying to process Query

"UserModule.ejbgrpx": Method Name: findByUserName

"UserModule.ejbgrpx": Parameter Types: (java.lang.String)

"UserModule.ejbgrpx": EJB Query: select object(u) from User u where u.userName=?1

"UserModule.ejbgrpx": )

"UserModule.ejbgrpx": Could not parse EJB QL expression: select object(u) from User u where u.userName=?1

"UserModule.ejbgrpx": ERROR: ejbc found errors

数据库中userName对应过来是String类型的

User---也没错,abstract schema name

返回类型设置为java.util.collection

猜你喜欢