Home > Back-end >  Mybatis one-to-one mapping, check out results has four, mapped to only one result set
Mybatis one-to-one mapping, check out results has four, mapped to only one result set

Time:10-01

The mapping
 






PID, PName, FPID CUID, CTime, BTime, ETime, status, PType, dar







ProjectCustom class
 
Public class ProjectCustom extends Project {


Private UserCustom bUser;


Public UserCustom getbUser () {
Return bUser;
}
Public void setbUser (UserCustom bUser) {
Enclosing bUser=bUser;
}

Private List Itemslist;//each item under the single
Private float scrose;//project achievement

Public List GetItemslist () {
Return itemslist;
}
Public void setItemslist (List Itemslist) {
Enclosing itemslist=itemslist;
}
Public float getScrose () {
Return scrose;
}
Public void setScrose (float scrose) {
Enclosing scrose=scrose;
}
@ Override
Public String toString () {
The return/* "custom projects: [uname=" + uname + ", buid="+ buid + */", bUser="
+ bUser + ", itemslist="+ itemslist +", scrose="+ scrose
+ "] ";
}



}





CodePudding user response:

plug value are you in

CodePudding user response:

Article 4 should be the same data, under your configuration resultMap tag,
 tag & lt; Id column="PID" property="PID" jdbcType="INTEGER"/& gt; 
representative to heavy, so only one will be shown

CodePudding user response:

Post you receive return result code, you want to get four should not receive the list with the results back?

CodePudding user response:

This property is property="bUser" on the Project
  • Related