Parameters are indexed, i.e. the correct query will be
<ejb-ql>select object(r) from Role as r where role_desc = ?1</ejb-ql>
alex
PSsc> But I still have more question for another findBy.....
PSsc> 17:17:02,411 WARN [ServiceController] Problem starting service
PSsc> jboss.j2ee:servi
PSsc> ce=EJB,jndiName=RoleRemoteHome
PSsc> org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested
PSsc> throwa
PSsc> ble: (org.jboss.ejb.plugins.cmp.ejbql.TokenMgrError: Lexical error at line
PSsc> 1, co
PSsc> lumn 52. Encountered: <EOF> after : "")
PSsc> Another findByDescription
PSsc> <query>
PSsc> <query-method>
PSsc> <method-name>findByDescription</method-name>
PSsc> <method-params>
PSsc> <method-param>java.lang.String</method-param>
PSsc> </method-params>
PSsc> </query-method>
PSsc> <result-type-mapping>Local</result-type-mapping>
PSsc> <ejb-ql>select object(r) from Role as r where role_desc
PSsc> = ?</ejb-ql>
PSsc> </query>
PSsc> What should I change?
PSsc> -phu
PSsc> Alex Loubyansky
PSsc> <[EMAIL PROTECTED]> To:
"[EMAIL PROTECTED]"
PSsc> Sent by:
<[EMAIL PROTECTED]>
PSsc> [EMAIL PROTECTED] cc:
PSsc> eforge.net Subject: Re[2]:
[JBoss-user] Error compiling ejbql
PSsc> No Phone Info Available
PSsc> 09/18/2002 02:07 PM
PSsc> Please respond to jboss-user
PSsc>> What is r? Should I define it before using? Could you give me an
PSsc> example?
PSsc> r is defined in the EJB-QL statement, e.g. 'Role as r'.
PSsc> alex
PSsc>> -phu
PSsc>> Dain Sundstrom
PSsc>> <[EMAIL PROTECTED]> To:
PSsc> [EMAIL PROTECTED]
PSsc>> Sent by: cc:
PSsc>> [EMAIL PROTECTED] Subject:
PSsc> Re: [JBoss-user] Error compiling ejbql
PSsc>> eforge.net
PSsc>> No Phone Info Available
PSsc>> 09/18/2002 11:55 AM
PSsc>> Please respond to jboss-user
PSsc>> SELECT OBJECT(r) FROM Role as r
PSsc>> The 'as' is optional
PSsc>> -dain
PSsc>> Dmitri Colebatch wrote:
>>> I _think_ the ejbql should be something like
>>>
>>> SELECT r FROM Role AS r
>>>
>>> hth
>>> dim
>>>
>>> ----- Original Message -----
>>> From: <[EMAIL PROTECTED]>
>>> To: <[EMAIL PROTECTED]>
>>> Sent: Wednesday, September 18, 2002 2:01 PM
>>> Subject: [JBoss-user] Error compiling ejbql
>>>
>>>
>>>
>>>>Got error when deploy application. Can anyone help?
>>>>
>>>>10:33:21,317 INFO [RoleEJB] Table 'role_map' already exists
>>>>10:33:21,337 WARN [ServiceController] Problem starting service
>>>>jboss.j2ee:servi
>>>>ce=EJB,jndiName=RoleRemoteHome
>>>>org.jboss.deployment.DeploymentException: Error compiling ejbql; -
PSsc> nested
>>>>throwa
>>>>ble: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered
PSsc> "<EOF>"
>>>>at lin
>>>>e 1, column 18.
>>>>Was expecting one of:
>>>> "AS" ...
>>>> <IDENTIFIER> ...
>>>> )
>>>> at
>>>>
>>>
>>>
PSsc>>
PSsc> org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.<init>(JDBCEJBQLQuery.java:46)
>>>
>>>>Definition in ejb-jar.xml
>>>>
>>>> <entity>
>>>> <description>User Role Entity Bean</description>
>>>> <ejb-name>RoleEJB</ejb-name>
>>>> <home>occs.RoleRemoteHome</home>
>>>> <remote>occs.RoleRemote</remote>
>>>> <ejb-class>occs.RoleBean</ejb-class>
>>>> <persistence-type>Container</persistence-type>
>>>> <prim-key-class>java.lang.Integer</prim-key-class>
>>>> <reentrant>False</reentrant>
>>>> <cmp-version>2.x</cmp-version>
>>>> <abstract-schema-name>Role</abstract-schema-name>
>>>> <cmp-field>
>>>> <field-name>roleID</field-name>
>>>> </cmp-field>
>>>> <cmp-field>
>>>> <field-name>roleDesc</field-name>
>>>> </cmp-field>
>>>> <primkey-field>roleID</primkey-field>
>>>> <query>
>>>> <query-method>
>>>> <method-name>findAll</method-name>
>>>> <method-params />
>>>> </query-method>
>>>> <result-type-mapping>Local</result-type-mapping>
>>>> <ejb-ql>select * from Role</ejb-ql>
>>>> </query>
>>>> </entity>
>>>>
--
Best regards,
Alex Loubyansky
-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts
on Hammer Technology! Open Source & Linux Developers, register now
for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user