欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
ibatis
從昨天下午到現在,一直在進(jìn)行ibatis環(huán)境下的單元測試,在測試中發(fā)現了一個(gè)奇怪的現象。
我們知道在sqlMap的insert語(yǔ)句中,一般需要一個(gè)bean類(lèi)來(lái)作為parameterClass的值,一般
來(lái)說(shuō),這個(gè)bean只要一些簡(jiǎn)單的get/set方法就可以了,但是在測試中卻發(fā)現這樣一個(gè)問(wèn)題:
如果該bean類(lèi)繼承java.util.ArrayList,那么這時(shí)再進(jìn)行sqlMapClient的insert則會(huì )報錯。
(當然了,如果不繼承java.util.ArrayList類(lèi)就不會(huì )出錯,繼承其它類(lèi)也不會(huì )出錯)
下面將出現錯誤的環(huán)境數據列出來(lái):
1,sqlMap

<insert id="simpleObjectTest" parameterClass="com.smartdot.galaxy.portal.resources.test.IbatisTestObject">
        insert into zhangbo_test (id,name
        values(#id#,#name#)
</insert>
2,IbatisTestObject?.java

public class IbatisTestObject extends ArrayList {

    private String id;
    private String name;
    public IbatisTestObject() {
        super();
    }
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
}
3,junit test

        ...
        IbatisTestObject obj=new IbatisTestObject();
        obj.setId("33");
        obj.setName("55");
        sqlMap.insert("simpleObjectTest",obj);
        ...
4,數據庫中字段id,name均為varchar2

5,出錯信息


com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/smartdot/galaxy/portal/resources/test/resources_sql_map.xml.  
--- The error occurred while preparing the mapped statement for execution.  
--- Check the simpleObjectTest.  
--- Check the parameter map.  
--- Cause: java.lang.NumberFormatException: For input string: "i"
Caused by: java.lang.NumberFormatException: For input string: "i"
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:90)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:442)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:85)
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:57)
    at com.smartdot.galaxy.portal.resources.test.ResourcesSqlMapTest.insertIbatisSimpleObj(ResourcesSqlMapTest.java:84)
    at com.smartdot.galaxy.portal.resources.test.ResourcesSqlMapTest.test(ResourcesSqlMapTest.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
Caused by: java.lang.NumberFormatException: For input string: "i"

       (更多略)

所以建議大家不要在Ibatis中的bean不要繼承java.util.ArrayList,而是使用復合模式。
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
運行Junit 出現 java.lang.ClassNotFoundException
談一談JUnit神奇的報錯 java.lang.Exception:No tests found matching
利用junit對springMVC的Controller進(jìn)行測試
org.hibernate.tool.schema.spi.SchemaManagementException Unable to execute schema management to 異常的解決
通向架構師的道路(第二十五天)SSH的單元測試與dbunit的整合
hibernate4 二級緩存demo實(shí)例
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久