error in into statement to convert result of query to calss

10 views
Skip to first unread message

Mostafa Shafeian

unread,
Jul 1, 2014, 10:31:36 AM7/1/14
to jooq...@googlegroups.com
Hi everybody
I wrote this command:
        res = PkgRptsearch.rptsearch(configuration.CreateConfiguration(), null); //execute query
        System.out.println("XML="+res.formatXML());
        List<pmodel> list= res.into(pmodel.class);
In output,Some fileds are be null but in xml format everything is ok.
Why do this problrm happen?
thanks


Lukas Eder

unread,
Jul 1, 2014, 11:29:49 AM7/1/14
to jooq...@googlegroups.com
Hello,

Can you be a bit more specific about the problem you're experiencing? From the code, I do not see what is not going well... For instance, can you show the stored procedure signature (e.g. does it return a refcursor?), the XML output, and the pmodel class?

Btw: What version of jOOQ are you using?

Best Regards,
Lukas


--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mostafa Shafeian

unread,
Jul 2, 2014, 2:18:44 AM7/2/14
to jooq...@googlegroups.com
hi
My sp return refcursor.
I used jooq 3.4.
Xml  result is :
<result xmlns="http://www.jooq.org/xsd/jooq-export-2.6.0.xsd"><fields><field name="BRANCHNAME" type="VARCHAR2"/><field name="ACCOUNTNUMBERTITLE" type="VARCHAR2"/><field name="ACCOUNTNUMBERSTORE" type="NUMBER"/><field name="ACCOUNTOPENSTOREMIN" type="NUMBER"/><field name="GAINDEPOSIT" type="VARCHAR2"/><field name="BRANCHCODE" type="NUMBER"/><field name="LETTERDATE" type="CHAR"/><field name="STORE" type="NUMBER"/></fields><records><record><value field="BRANCHNAME">xxx</value><value field="ACCOUNTNUMBERTITLE">xxxxxxx</value><value field="ACCOUNTNUMBERSTORE">91950000</value><value field="ACCOUNTOPENSTOREMIN">50000</value><value field="GAINDEPOSIT"/><value field="BRANCHCODE">7894</value><value field="LETTERDATE"/><value field="STORE">0214578</value></record>


pmodel same as:

     private String GAINDEPOSIT;
     private Integer BRANCHCODE;
     private String LETTERDATE;
     private long STORE; 

  public void setGAINDEPOSIT(String  GAINDEPOSIT) {
        this.GAINDEPOSIT =  GAINDEPOSIT;
    }
        /**
     * @return the  BRANCHCODE
     */
         public Integer getBRANCHCODE() {
         return  BRANCHCODE;
    }

    /**
     * @param  BRANCHCODE the  BRANCHCODE to set
     */
    public void SetBRANCHCODE(Integer  BRANCHCODE) {
        this.BRANCHCODE=  BRANCHCODE;
    }
   
         /**
     * @return the  LETTERDATE
     */
         public String getLETTERDATE() {
         return  LETTERDATE;
    }

    /**
     * @param  LETTERDATE the  LETTERDATE to set
     */
    public void SetLETTERDATE(String  LETTERDATE) {
        this.LETTERDATE =  LETTERDATE;
    }

       /**
     * @return the  STORE
     */
         public long getSTORE() {
         return  STORE;
    }

Lukas Eder

unread,
Jul 2, 2014, 6:25:03 AM7/2/14
to jooq...@googlegroups.com
Hi Mostafa,

Thanks for the additional information. Looking at your POJO, I've noticed that a couple of setters use upper-case "S" in "Set". That's not standard JavaBeans convention, and is not supported by jOOQ's DefaultRecordMapper:

E.g. change SetLETTERDATE to setLETTERDATE

Hope this helps,
Lukas

Mostafa Shafeian

unread,
Jul 2, 2014, 7:00:12 AM7/2/14
to jooq...@googlegroups.com
hi Lukas
Thanks for your reply.
It helped  me.

On Tuesday, July 1, 2014 7:01:36 PM UTC+4:30, Mostafa Shafeian wrote:
Reply all
Reply to author
Forward
0 new messages