-
There is no statement named...错误, 使用了abator5
红色为感觉程序用到的部分. 命名对比认为没有问题, 不知道哪里错了...
错误信息:
com.ibatis.sqlmap.client.SqlMapException: There is no statement named WAP_USERS.abatorgenerated_selectByExample in this SqlMap.
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(SqlMapExecutorDelegate.java:231)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:558)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:94)
at com.hnmcc.wap.dao.UsersDAOImpl.selectByExample(UsersDAOImpl.java:69)
at com.hnmcc.wap.bean.dbDemo.main(dbDemo.java:38)dbDemo.jsp
public class dbDemo { /** * @param args * @throws Exception */ public static void main(String[] args) throws IOException { String resource = "com/hnmcc/wap/entity/WAP_USERS_SqlMap.xml"; SqlMapClient sqlMap = null; try { Reader reader = Resources.getResourceAsReader(resource); sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader); } catch(Exception e) { e.printStackTrace(); } try { UsersExample ue = new UsersExample(); ue.setOrderByClause("ID"); UsersDAOImpl dao = new UsersDAOImpl(sqlMap); List ls = dao.selectByExample(ue); for(Object obj : ls) { Users user = (Users)obj; System.out.println("id : " + user.getId()); System.out.println("username : " + user.getUsername()); System.out.println("passowrd : " + user.getPassword()); System.out.println("role : " + user.getRole()); System.out.println(); } } catch(Exception e) { e.printStackTrace(); } finally { sqlMap = null; } } }
UsersDAOImpl.java
public class UsersDAOImpl implements UsersDAO { private SqlMapClient sqlMapClient; public UsersDAOImpl(SqlMapClient sqlMapClient) { super(); this.sqlMapClient = sqlMapClient; } public void insert(Users record) throws SQLException { sqlMapClient.insert("WAP_USERS.abatorgenerated_insert", record); } public int updateByPrimaryKey(Users record) throws SQLException { int rows = sqlMapClient.update("WAP_USERS.abatorgenerated_updateByPrimaryKey", record); return rows; } public int updateByPrimaryKeySelective(Users record) throws SQLException { int rows = sqlMapClient.update("WAP_USERS.abatorgenerated_updateByPrimaryKeySelective", record); return rows; } public List selectByExample(UsersExample example) throws SQLException { List list = sqlMapClient.queryForList("WAP_USERS.abatorgenerated_selectByExample", example); return list; } public Users selectByPrimaryKey(BigDecimal id) throws SQLException { Users key = new Users(); key.setId(id); Users record = (Users) sqlMapClient.queryForObject("WAP_USERS.abatorgenerated_selectByPrimaryKey", key); return record; } public int deleteByExample(UsersExample example) throws SQLException { int rows = sqlMapClient.delete("WAP_USERS.abatorgenerated_deleteByExample", example); return rows; } public int deleteByPrimaryKey(BigDecimal id) throws SQLException { Users key = new Users(); key.setId(id); int rows = sqlMapClient.delete("WAP_USERS.abatorgenerated_deleteByPrimaryKey", key); return rows; } public int countByExample(UsersExample example) throws SQLException { Integer count = (Integer) sqlMapClient.queryForObject("WAP_USERS.abatorgenerated_countByExample", example); return count.intValue(); } public int updateByExampleSelective(Users record, UsersExample example) throws SQLException { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = sqlMapClient.update("WAP_USERS.abatorgenerated_updateByExampleSelective", parms); return rows; } public int updateByExample(Users record, UsersExample example) throws SQLException { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = sqlMapClient.update("WAP_USERS.abatorgenerated_updateByExample", parms); return rows; } private static class UpdateByExampleParms extends UsersExample { private Object record; public UpdateByExampleParms(Object record, UsersExample example) { super(example); this.record = record; } public Object getRecord() { return record; } } }
WAP_USERS_SqlMap.xml
<!----> <sqlmap namespace="WAP_USERS"> <resultmap id="abatorgenerated_UsersResult" class="com.hnmcc.wap.entity.Users"> <!----> <result column="ID" property="id" jdbctype="DECIMAL"> <result column="USERNAME" property="username" jdbctype="VARCHAR"> <result column="PASSWORD" property="password" jdbctype="VARCHAR"> <result column="ROLE" property="role" jdbctype="DECIMAL"> </resultmap> <sql id="abatorgenerated_Example_Where_Clause"> <!----> <iterate property="oredCriteria" conjunction="or" prepend="where" removefirstprepend="iterate"> <isequal property="oredCriteria[].valid" comparevalue="true"> ( <iterate prepend="and" property="oredCriteria[].criteriaWithoutValue" conjunction="and"> $oredCriteria[].criteriaWithoutValue[]$ </iterate> <iterate prepend="and" property="oredCriteria[].criteriaWithSingleValue" conjunction="and"> $oredCriteria[].criteriaWithSingleValue[].condition$ #oredCriteria[].criteriaWithSingleValue[].value# </iterate> <iterate prepend="and" property="oredCriteria[].criteriaWithListValue" conjunction="and"> $oredCriteria[].criteriaWithListValue[].condition$ <iterate property="oredCriteria[].criteriaWithListValue[].values" open="(" close=")" conjunction=","> #oredCriteria[].criteriaWithListValue[].values[]# </iterate> </iterate> <iterate prepend="and" property="oredCriteria[].criteriaWithBetweenValue" conjunction="and"> $oredCriteria[].criteriaWithBetweenValue[].condition$ #oredCriteria[].criteriaWithBetweenValue[].values[0]# and #oredCriteria[].criteriaWithBetweenValue[].values[1]# </iterate> ) </isequal> </iterate> </sql> <select id="Abatorgenerated_selectByPrimaryKey"> <!----> select ID, USERNAME, PASSWORD, ROLE from WAP.USERS where ID = #id:DECIMAL# </select> <select id="abatorgenerated_selectByExample"> <!----> select ID, USERNAME, PASSWORD, ROLE from WAP.USERS <isparameterpresent> <include refid="WAP_USERS.abatorgenerated_Example_Where_Clause"> <isnotnull property="orderByClause"> order by $orderByClause$ </isnotnull> </isparameterpresent> </select> <delete id="abatorgenerated_deleteByPrimaryKey" parameterclass="com.hnmcc.wap.entity.Users"> <!----> delete from WAP.USERS where ID = #id:DECIMAL# </delete> <delete id="abatorgenerated_deleteByExample" parameterclass="com.hnmcc.wap.entity.UsersExample"> <!----> delete from WAP.USERS <include refid="WAP_USERS.abatorgenerated_Example_Where_Clause"> </delete> <insert id="abatorgenerated_insert" parameterclass="com.hnmcc.wap.entity.Users"> <!----> insert into WAP.USERS (ID, USERNAME, PASSWORD, ROLE) values (#id:DECIMAL#, #username:VARCHAR#, #password:VARCHAR#, #role:DECIMAL#) </insert> <update id="abatorgenerated_updateByPrimaryKey" parameterclass="com.hnmcc.wap.entity.Users"> <!----> update WAP.USERS set USERNAME = #username:VARCHAR#, PASSWORD = #password:VARCHAR#, ROLE = #role:DECIMAL# where ID = #id:DECIMAL# </update> <update id="abatorgenerated_updateByPrimaryKeySelective" parameterclass="com.hnmcc.wap.entity.Users"> <!----> update WAP.USERS <dynamic prepend="set"> <isnotnull prepend="," property="username"> USERNAME = #username:VARCHAR# </isnotnull> <isnotnull prepend="," property="password"> PASSWORD = #password:VARCHAR# </isnotnull> <isnotnull prepend="," property="role"> ROLE = #role:DECIMAL# </isnotnull> </dynamic> where ID = #id:DECIMAL# </update> <select id="abatorgenerated_countByExample"> <!----> select count(*) from WAP.USERS <include refid="WAP_USERS.abatorgenerated_Example_Where_Clause"> </select> <update id="abatorgenerated_updateByExampleSelective"> <!----> update WAP.USERS <dynamic prepend="set"> <isnotnull prepend="," property="record.id"> ID = #record.id:DECIMAL# </isnotnull> <isnotnull prepend="," property="record.username"> USERNAME = #record.username:VARCHAR# </isnotnull> <isnotnull prepend="," property="record.password"> PASSWORD = #record.password:VARCHAR# </isnotnull> <isnotnull prepend="," property="record.role"> ROLE = #record.role:DECIMAL# </isnotnull> </dynamic> <isparameterpresent> <include refid="WAP_USERS.abatorgenerated_Example_Where_Clause"> </isparameterpresent> </update> <update id="abatorgenerated_updateByExample"> <!----> update WAP.USERS set ID = #record.id:DECIMAL#, USERNAME = #record.username:VARCHAR#, PASSWORD = #record.password:VARCHAR#, ROLE = #record.role:DECIMAL# <isparameterpresent> <include refid="WAP_USERS.abatorgenerated_Example_Where_Clause"> </isparameterpresent> </update> </sqlmap>
abatorConfig.xml
<!----> <abatorconfiguration> <abatorcontext> <jdbcconnection driverclass="oracle.jdbc.driver.OracleDriver" connectionurl="jdbc:oracle:thin:@192.168.0.103:1521:orcl10g" userid="wap" password="wap"> <classpathentry location="G:\oracle\product\10.1.0\Db_1\jdbc\lib\ojdbc14.jar"> </jdbcconnection> <javamodelgenerator targetpackage="com.hnmcc.wap.entity" targetproject="WAP"> <sqlmapgenerator targetpackage="com.hnmcc.wap.entity" targetproject="WAP"> <daogenerator targetpackage="com.hnmcc.wap.dao" targetproject="WAP" type="GENERIC-CI">
2008年9月07日 12:42
目前还没有答案
相关推荐
之前一直找原因,最后知道了解决方法,具体请下载源码查看。特别是用到throw的事务中
在上述配置中,`jobExecutionService`是自定义的Job执行类,它需要实现`org.quartz.Job`接口或者使用Spring的`MethodInvokingJobDetailFactoryBean`来调用特定方法。`CronTriggerFactoryBean`用于设置触发器的执行...
前几天在网上下载一个struts2的helloword的例子,那个作者也真够缺德的,搞个错误的程序,害得我查了一天的程序错误。 最后发现竟然是struts.xml被写成啦sturts.xml。 碰见这样的问题先鄙视下提供例子的作者, 再...
然而,当遇到单个参数是基本类型如`java.lang.Integer`或`java.lang.String`时,如果按照处理对象类型的参数方式直接在`<if>`中使用参数名,可能会遇到异常`There is no getter for property named 'xxx' in 'class ...
在Web开发中,尤其是使用基于Java的Web框架如Struts时,开发者可能会遇到一个常见的问题:“HTTP Status 404 - There is no Action mapped for namespace and action name BackMemberGroupAudit”。这个问题通常出现...
我选择SAP CAP项目的db文件夹,右键选择build时,遇到如下... Can not create service instance ‘Products-Products-db-hdi-container8HPfzrS/PBqVvnsD’: There is no database available. Ensure that you have a
标题“Show Message When There is No Disk in a Drive”暗示了一个编程任务,即创建一个程序,当某个驱动器没有插入磁盘时,会在屏幕上显示一条消息。这个任务涉及到基础的系统交互、事件处理以及用户界面设计。...
If there is no PK, state so. Fully justify your answer. 2. For each table, indicate the Alternate Key(s) (AKs). If there is no AK, state so. Fully justify your answer. 3. For each table, identify ...
9. There were no factories, hospitals and schools here fifty years ago.(过去时态,用were) 10. There may be something wrong with your watch.(情态动词后用动词原形be) 11. There isn't any mail for you...
在Hadoop分布式文件系统(HDFS)的运行过程中,可能会遇到一个常见的错误,即"ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation. Starting datanodes"。这个错误通常意味着系统在尝试启动...
Convert string to numeric value of type _Tp and store results. NB: This is specialized for all required types, there is no generic definition.
- There is some milk in the bottle.(改为一般疑问句)→ Is there any milk in the bottle? 肯定回答:Yes, there is. 否定回答:No, there isn't. 5. 特殊疑问句形式: - 询问人:用"Who is ⋯?"或"Who's ⋯...
例如:There is no denying that diligence is indispensable for academic success. 3. **表达“我深信”的句型**: - I am greatly convinced that... - I am greatly assured that... 例如:I am greatly ...
9. "There is one mistake I'd like to point out." 使用 "there is" 表示存在的一个错误,表明作者想要指出。 10. "There might be a cleverer way to do this." 这里 "there might be" 表达了一种可能性,暗示...
在使用Docker的过程中,有时可能会遇到“`There are no more lookback devices available`”的错误提示,这通常意味着你的Linux操作系统已经用完了所有的Loopback(回环)设备,而这些设备是Docker运行容器时所需的...
1. Visual C++ 库错误:安装过程中,进度条推进至99%时,系统提示Visual C++ 15库出现问题。 2. Wincap安装提示:系统弹窗提示需要安装Wincap,但不安装也能够继续。 ### 解决方案 #### 问题1:Visual C++库错误 这...
而在"There is a pen, two books and many pencils on the desk."中,虽然后面跟着多个物品,但"be"动词与最近的"a pen"保持一致,因此使用"is"。 2. **与have的比较**:`There be`强调的是存在,强调的是在某个...
9. "Have/Has" 与 "There is/There are" 的使用: - "Have/Has" 主要用于表示某人拥有某物,如"I have a good father and a good mother."(我有一个好父亲和一个好母亲。) - "There is/There are" 用于表示某地...
- Let’s talk: 包含了一段对话,学生需在图片辅助下理解并模仿使用"There is…"句型,如"There is a big bed."和"There is a nice photo, too.",同时引入新单词"photo"。 3. 教学目标: - 听力理解:学生应能...
- 对于回答,肯定形式是"Yes, there is/are.",否定形式是"No, there isn’t/aren’t." 6. **练习题解析**: - 在例题中,我们看到一系列的填空和选择题,旨在让学生掌握"There be"句型的正确运用。例如,"There ...