Kunde
オブジェクトと双方向の onetomany 関係にあるAnsprechpartner
オブジェクトを、再帰を取得せずにコピーしたいと考えています。
コピー機能Kunde
public void Copy(Kunde another) {
this.m_sKunde_nr = another.getKunde_nr();
this.m_sMdkz = another.getMdkz();
this.m_sName = another.getName();
this.m_sStrasse = another.getStrasse();
this.m_sPlz = another.getPlz();
this.m_sOrt = another.getOrt();
this.m_sTelnr = another.getTelnr();
this.m_sEmail_auftrag = another.getEmail_auftrag();
this.m_sEmail_allgemein = another.getEmail_allgemein();
this.m_dbLng = another.getLng();
this.m_dbLat = another.getLat();
for(Ansprechpartner a : another.getAnsprechpartner()) {
this.m_lAnsprechpartner.add(new Ansprechpartner());
this.m_lAnsprechpartner.get(this.m_lAnsprechpartner.size()-1).Copy(a);
}
}
コピー機能Ansprechpartner
public void Copy(Ansprechpartner another) {
this.m_nAnsprechpartner_nr = another.getAnsprechpartner_nr();
this.m_sMdkz = another.getMdkz();
this.m_sName = another.getName();
this.m_sTelnr = another.getTelnr();
this.m_sEmail = another.getEmail();
this.m_sVerantwortlichkeit = another.getVerantwortlichkeit();
this.m_kunde = new Kunde();
this.m_kunde.Copy(another.getKunde());
}
StackOverFlow を取得せずにこれを行う方法はありますか?