Thank you Alexey,
I tried it. But it doesn't work as dynamic-ql.
I put following query in the <ejb-ql>.
----query---
SELECT count(distinct ur.monitorID) FROM UserResponse As
ur where ur.responseData = 'n'
------------
This query return '2' in
SQLServer2000Consol(EnterpriseManager).
And I use query as dynamic-ql in the Bean.
----query---
SELECT count(distinct ur.monitorID) FROM UserResponse As
ur where ur.responseData = '0123'
------------
This query return '1' in
SQLServer2000Consol(EnterpriseManager).
There is no consol error msgs, When it deploied to JBOSS.
But, it returned '2'.
So it doesn't work as dynamic-ql.
The query in the <ejb-ql> is active,
The dynamic-ql in the bean is not active.
(If it work as dynamic-ql, it return '1'.)
please help me..
---jbosscmp-jdbc.xml---
<query>
<query-method>
<method-name>ejbSelectScreeningAbleNumFromUserResponseNum</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.Object[]</method-param>
</method-params>
</query-method>
<dynamic-ql/>
</query>
------------
---ejb-jar.xml---
<query>
<description><![CDATA[]]></description>
<query-method>
<method-name>ejbSelectScreeningAbleNumFromUserResponseNum</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.Object[]</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT count(distinct ur.monitorID) FROM
UserResponse As ur where ur.responseData = 'n']]></ejb-ql>
</query>
<query>
<query-method>
<method-name>findByLastRespons</method-name>
<method-params>
<method-param>int</method-param>
<method-param>java.lang.String</method-param>
<method-param>int</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT Object(ur) FROM UserResponse ur
WHERE ur.orderNo = -1 and ur.groupID = ?1 and ur.monitorID
= ?2 and ur.itemNo = 0 and ur.sub0No = ?3 and ur.sub1No =
1]]></ejb-ql>
</query>
<query>
<query-method>
<method-name>findByOrderResponsStatus</method-name>
<method-params>
<method-param>int</method-param>
<method-param>java.lang.String</method-param>
<method-param>int</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT Object(ur) FROM UserResponse ur
WHERE ur.orderNo = -1 and ur.groupID = ?1 and ur.monitorID
= ?2 and ur.itemNo = 0 and ur.sub1No = 1 and ur.sub2No =
?3]]></ejb-ql>
</query>
<query>
<query-method>
<method-name>findBankAccount</method-name>
<method-params>
<method-param>int</method-param>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT Object(ur) FROM UserResponse ur
WHERE ur.orderNo = -1 and ur.groupID = ?1 and ur.monitorID
= ?2 and ur.itemNo = 1 and ur.sub0No = 1]]></ejb-ql>
</query>
------------
---Bean-----
package research;
import javax.ejb.*;
abstract public class UserResponseBean implements
EntityBean {
EntityContext entityContext;
public abstract void setOrderNo(int orderNo);
public abstract void setGroupID(int groupID);
public abstract void setMonitorID(String monitorID);
public abstract void setItemNo(int itemNo);
public abstract void setSub0No(int sub0No);
public abstract void setSub1No(int sub1No);
public abstract void setSub2No(int sub2No);
public abstract void setSub3No(int sub3No);
public abstract void setSub4No(int sub4No);
public abstract void setResponseData(String responseData);
public abstract void setInputTime(java.sql.Timestamp
inputTime);
public abstract void setRefreshSchedule(int
refreshSchedule);
public abstract int getOrderNo();
public abstract int getGroupID();
public abstract String getMonitorID();
public abstract int getItemNo();
public abstract int getSub0No();
public abstract int getSub1No();
public abstract int getSub2No();
public abstract int getSub3No();
public abstract int getSub4No();
public abstract String getResponseData();
public abstract java.sql.Timestamp getInputTime();
public abstract int getRefreshSchedule();
//=================DynamicQL===================
public abstract int
ejbSelectScreeningAbleNumFromUserResponseNum(String
jbossQL, java.lang.Object[] arguments) throws
FinderException;
public int ejbHomeGetScreeningAbleNumFromUserResponseNum()
throws FinderException
{
StringBuffer jbossQL = new StringBuffer();
jbossQL.append("SELECT count(distinct ur.monitorID) FROM
UserResponse As ur where ur.responseData = '0123'");
java.lang.Object[] args = null;
return
ejbSelectScreeningAbleNumFromUserResponseNum(jbossQL.toString(),
args);
}
public abstract void
setUserResponseValue(UserResponseValue userResponse);
public abstract UserResponseValue getUserResponseValue();
public UserResponsePK ejbCreate(UserResponseValue
userResponseValue) throws CreateException {
setOrderNo(userResponseValue.getOrderNo());
setGroupID(userResponseValue.getGroupID());
setMonitorID(userResponseValue.getMonitorID());
setItemNo(userResponseValue.getItemNo());
setSub0No(userResponseValue.getSub0No());
setSub1No(userResponseValue.getSub1No());
setSub2No(userResponseValue.getSub2No());
setSub3No(userResponseValue.getSub3No());
setSub4No(userResponseValue.getSub4No());
setResponseData(userResponseValue.getResponseData());
setInputTime(userResponseValue.getInputTime());
setRefreshSchedule(userResponseValue.getRefreshSchedule());
return null;
}
}
------------
> -----Original Message-----
> Looks like for some reason it doesn't think that it
> is dynamic. It does
> work for me with DR4. If you put some query in the
> <ejb-ql> will it work
> as dynamic?
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On
> Behalf Of ?? ?
> > Sent: Sunday, May 09, 2004 12:22 PM
> > To: [EMAIL PROTECTED]
> > Subject: [JBoss-user] error compiling ejbql
> (dynamicQL):
> > EJB-QL statement '';
> >
> > Hi all
> > I'm trying to use JBoss Dynamic-QL
> >
> > But When I submit the following Dynamic-QL, I get
> the
> > following consol error msgs.
> >
> > ---ConsolErrorMessages---
> > ERROR [EntityContainer] Starting failed
> > org.jboss.deployment.DeploymentException: Error
> compiling
> > EJB-QL statement ''; - nested throwable:
> > (org.jboss.ejb.plugins.cmp.ejbql.ParseException:
> FROM not
> > found)
> > ------------------------
> >
> >
> > in jbosscmp-jdbc.xml tell JBoss that this method
> is dynamic.
> > So, <ejb-ql>value is empty in the ejb-jar.xml.
> >
> > reference is 117/207Page of ejbwJboss.eBook.pdf
> >
>
http://www.univ-orleans.fr/SCIENCES/INFO/RESSOURCES/modules/si
> > r/ejbwJboss.eBook.pdf
> >
> >
> > ---ejb-jar.xml---
> > <query>
> > <description><![CDATA[]]></description>
> > <query-method>
> >
>
<method-name>ejbSelectScreeningAbleNumFromUserResponseNum</met
> > hod-name>
> > <method-params>
> > <method-param>java.lang.String</method-param>
> > <method-param>java.lang.Object[]</method-param>
> > </method-params>
> > </query-method>
> > <ejb-ql></ejb-ql>
> > </query>
> > ------------------------
> >
> > ---jbosscmp-jdbc.xml---
> > <query>
> > <query-method>
> >
>
<method-name>ejbSelectScreeningAbleNumFromUserResponseNum</met
> > hod-name>
> > <method-params>
> > <method-param>java.lang.String</method-param>
> > <method-param>java.lang.Object[]</method-param>
> > </method-params>
> > </query-method>
> > <dynamic-ql/>
> > </query>
> > ------------------------
> >
> > ---CMP Xdoclet (ClassLevel)---
> > * @jboss.query
> > * dynamic = "true"
> > * signature = "int
> >
>
ejbSelectScreeningAbleNumFromUserResponseNum(java.lang.String
> > jbossQL, java.lang.Object[] arguments)"
> > ------------------------
> >
> > ---CMP Xdoclet (MethodLevel)---
> > /**
> > */
> > public abstract int
> >
> ejbSelectScreeningAbleNumFromUserResponseNum(String
> > jbossQL, java.lang.Object[] arguments) throws
> FinderException;
> > /**
> > * @ejb.home-method
> > */
> > public int
> ejbHomeGetScreeningAbleNumFromUserResponseNum()
> > throws FinderException
> > {
> > StringBuffer jbossQL = new StringBuffer();
> > jbossQL.append("SELECT count(distinct
> ur.monitorID) FROM
> > UserResponse As ur where ur.responseData =
> '0123'");
> > java.lang.Object[] args = null; return
> >
>
ejbSelectScreeningAbleNumFromUserResponseNum(jbossQL.toString(),
> > args);
> > }
> > ------------------------
> > jboss-4.0.0DR3
> > Does anyone recognize what the problem could be
> here?
> > Any help is appreciated.
> > masaru
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user