Grougby for 1:1 relationship
----------------------------

         Key: IBATIS-231
         URL: http://issues.apache.org/jira/browse/IBATIS-231
     Project: iBatis for Java
        Type: Wish
  Components: SQL Maps  
 Environment: Windows
    Reporter: Leo Tu


I have two classes, one is Parent(master) another is Child(Detail), but they 
are 1:1 relationship,
The question is that in child class contains just one parent object, but i must 
use List for getter/setter elsewise
has problem, why ?

===================================================
// parent
public class CustGroup {
 ...
}

// child
public class Cust {
   ...
 private CustGroup custGroup; // 1:1
  ...
  public void setCustGroupjava.util.List custGroupList) { ... } //  why it must 
be List data type ?
  public java.util.List getCustGroup()  { ... } //  why it must be List data 
type ?
  ...
}

<resultMap id="CustGroup-result" class="CustGroup">
   ...
</resultMap>

<resultMap id="CUST-result" class="Cust">
   ...   
     <result property="custGroup" resultMap="CUST_GROUP"/> <!-- 1:1 -->
</resultMap>
===================================================

1:1, but groupby must use List for getter/setter, 
Can't  use 

  public void setCustGroup(CustGroup custGroup) { ... } //  I hope  can use 
this methd
  public CustGroup getCustGroup()  { ... }  //  I hope  can use this methd

Best Regards,
Leo



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to