Hello...

What's the correct syntax for using entity beans in declared-sql? With the
configuration below, I'm getting the exception
"java.lang.IllegalArgumentException: Could not find a field for the cmp-jdbc
data for entity with the interface unb.ead.ejb.UsuarioLocal"

Putting a e.printStackTrace in line 322 of QueryParameter.java (JBoss
release 3.0.0) shows me
2002-06-15 21:51:42,829 ERROR [STDERR] java.lang.ClassCastException:
org.jboss.resource.connectionmanager.CachedConnectionInterceptor
2002-06-15 21:51:42,829 ERROR [STDERR]  at
org.jboss.ejb.plugins.cmp.jdbc.QueryParameter.getCMPField(QueryParameter.jav
a:304)
2002-06-15 21:51:42,829 ERROR [STDERR]  at
org.jboss.ejb.plugins.cmp.jdbc.QueryParameter.<init>(QueryParameter.java:189
)

I'm doing something wrong here?

Robson

The relevant part of jbosscmp-jdbc.xml is copied below:
            <query>
                <query-method>
                    <method-name>findByInscricaoDisponivel</method-name>
                    <method-params>

<method-param>unb.ead.ejb.UsuarioLocal</method-param>
                        <method-param>java.sql.Date</method-param>
                    </method-params>
                </query-method>
                <declared-sql>
                    <select>
                        <distinct/>
                        <alias>c</alias>
                    </select>
                    <from><![CDATA[
LEFT JOIN t_usuario_curso uc ON c.cur_id = uc.cur_id
LEFT JOIN t_coord_curso cc ON c.cur_id = cc.cur_id
LEFT JOIN t_professor p ON p.prof_id = cc.prof_id
LEFT JOIN t_usuario u1 ON uc.usu_id = u1.usu_id
LEFT JOIN t_usuario u2 ON p.usu_id  = u2.usu_id
]]>
                    </from>
                    <where><![CDATA[
c.cur_disponivel AND
((c.cur_inscr_inicio IS NULL or c.cur_inscr_inicio <= {1}) AND
 (c.cur_inscr_fim IS NULL or c.cur_inscr_fim >= {1})) AND
(u2.usu_id <> {0.id} OR u2.usu_id IS NULL) AND
((u1.usu_id <> {0.id} OR u1.usu_id IS NULL) OR
(u1.usu_id = {0.id} AND uc.uc_inscricao IS NULL))
]]>
                    </where>
                    <order>c.cur_nome</order>
                </declared-sql>
            </query>



_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - 
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to