java - ibatis - How to map list of value -
i have select statement returns list of values of same datatype (varchar). result anywhere between 1 6 rows.i'm using queryforlist() , storing response in list object. when executing i'm getting error
--- cause: com.ibatis.sqlmap.client.sqlmapexception: no type handler found map property 'statuslist' column 'null'. 1 or both of types, or combination of types not supported.
the sql query, when executed in sql window, returns 3 rows. please assist? in advance
<resultmap id="retrievestatusresult" class="ie.org.model.responsebo"> <result property="statuslist" columnindex="1" /> </resultmap> <select id="retrievestatus" parameterclass="ie.org.model.requestbo" resultmap="retrievestatusresult"> select (select description tablea lcd lcd.code_detail = qpl.status) tableb qpl qpl.quote=#quote# , version in (select version tableb quote = #quote#) </select> responsebo.java
private list statuslist = new arraylist(); public list getstatuslist() { return statuslist; } public void setstatuslist(list statuslist) { this.statuslist = statuslist; }
you not mapping results properly/your bo wrong.
when use queryforlist(), trying create list of objects have in resultmap. , in bo trying create list each row of query answer.
you should use bo this:
private string status; public string getstatus() { return status; } public void setstatus(string status) { this.status = status; } which has proper type answer of query.
to use results of query call statement this:
list<responsebo> liststatus = new arraylist<responsebo>(); liststatus = (list<responsebo>)queryforlist("retrievestatus",properys); propertys hashmap query parameters
Comments
Post a Comment