I have two table: plc and zxfd, plc is the parent and zxfd is the child. I use one-to-many relation, and query the plc and a set of zxfd according to plc's primary key. It should return 29 zxfd records(the set size should be 29), but I alwasy get just one. In the hibernate properties, I set hibernate.use_outer_join=true. Anyone please tell me, what's the problem, and how to get the correct query result?
The class files and the mapping files are:
plc.java:
Code:
/*
* Created on 2003-12-29
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
/**
* @author Administrator
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
import java.util.*;
import java.io.*;
import java.lang.reflect.*;
/**
* @hibernate.class table="t_plc"
*
* @author Yingzi Jin
*
* Represents a t_plc
*/
public class plc implements Serializable {
private Double sum_pre;
// decimal(10,2) yes
private String p_no;
// char(20) no
private String fgs;
// char(7) no
private String edrno;
// char(20) no
private String plc_no;
// char(20) yes
private String xyh;
// char(20) yes
private String xykh;
// char(30) yes
private String xzhdm;
// char(8) no
private Short isnewver;
// smallint yes
private String zhfl;
// char(3) yes
private Short isnumsdisc;
// smallint yes
private String kh_no;
// char(20) yes
private String applier;
// varchar(40,0) no
private String lia_addr; // varchar(50,0)
private String apl_mail_cod;
// char(8) yes
private String apl_tele_no;
// char(20) yes
private String apl_email;
// char(18) yes
private String apl_liaison;
// char(8) yes
private String urb_rur;
// char(20) yes
private String insured;
// varchar(40,0) yes
private String ec_natu;
// varchar(50,0) yes
private String mail_cod;
// char(8) yes
private String tele_no;
// char(20) yes
private String email;
// char(18) yes
private String liaison;
// char(8) yes
private String bank_nam;
// char(8) yes
private String acct_no;
// char(20)
private Date prop_da; // date
private Date issue_da;
// date yes
private Date start_da;
// datetime year to hour no
private Date end_date;
// datetime year to hour no
private Double timerate;
// decimal(8,3) no
private Short zdzq;
// smallint yes
private Date kz_start_da;
// date yes
private Date kz_end_date;
// date yes
private Short pre_tot_veh;
// smallint yes
private Short tot_veh;
// smallint no
private Double tot_sum;
// decimal(10,0) no
private Double year_tot_fhje;
// decimal(10,2) yes
private Double tot_fhje;
// decimal(10,2) no
private Double year_tot_pre;
// decimal(10,2) yes
private Double adj_pre; // decimal(10,2)
private Double tot_pre;
// decimal(10,2) no
private Double adjratio;
// decimal(12,8) yes
private Double act_pre;
// decimal(10,2) no
private Short tot_md;
// smallint no
private Short p_count;
// smallint yes
private Short pay_way;
// smallint yes
private Date del_date;
// date yes
private String old_pno;
// char(20) yes
private Character renewed;
// char(1) yes
private Short risk_count;
// smallint yes
private Short renew_years;
// smallint yes
private Character neikou;
// char(1) yes
private Character cleared;
// char(1) yes
private Date last_t_date; // date
private Date last_u_date;
// date yes
private Double nkje;
// decimal(10,2) no
private Character lrfs;
// char(1) yes
private String bzhdm;
// char(2) no
private Character zhcfsh;
// char(1) yes
private String zcjg;
// varchar(20,0) yes
private String zyfs;
// char(2) yes
private String maker;
// char(8) no
private String bmdm;
// char(3) no
private String kshdm;
// char(3) no
private String dlddm;
// char(5) yes
private String verifier;
// char(8) yes
private String hby;
// char(6) yes
private String hb_fgs; // char(7)
private Date hbrq;
// datetime year to second yes
private String operator;
// char(8) yes
private Date lrrq;
// datetime year to second yes
private Character cbfs;
// char(1) no
private String printer;
// char(8) yes
private Short printnums;
// smallint yes
private String printno;
// char(20) yes
private Character grade;
// char(1) yes
private Character pol_kind;
// char(1) no
private Date sttldate;
// date yes
private String mobile;
// char(20) yes
private String tbdm;
// char(5) no
private Double mpje; // decimal(12,2)
private String omnicard; // char(20)
private String areacode;
// char(2) yes
private String bmzdm;
// char(6) yes
private String org_num; // char(12)
private Set zxfdSet;
private HashMap hmap = new HashMap();
/**
* @hibernate.property column="acct_no" type="string"
* @return String
*/
public String getAcct_no() {
return acct_no;
}
/**
* @hibernate.property column="act_pre" type="double"
* @return Double
*/
public Double getAct_pre() {
return act_pre;
}
/**
* @hibernate.property column="adj_pre" type="double"
* @return Double
*/
public Double getAdj_pre() {
return adj_pre;
}
/**
* @hibernate.property column="adjratio" type="double"
* @return Double
*/
public Double getAdjratio() {
return adjratio;
}
/**
* @hibernate.property column="apl_email" type="string"
* @return String
*/
public String getApl_email() {
return apl_email;
}
/**
* @hibernate.property column="apl_liaison" type="string"
* @return String
*/
public String getApl_liaison() {
return apl_liaison;
}
/**
* @hibernate.property column="apl_mail_cod" type="string"
* @return String
*/
public String getApl_mail_cod() {
return apl_mail_cod;
}
/**
* @hibernate.property column="apl_tele_no" type="string"
* @return String
*/
public String getApl_tele_no() {
return apl_tele_no;
}
/**
* @hibernate.property column="applier" type="string"
* @return String
*/
public String getApplier() {
return applier;
}
/**
* @hibernate.property column="areacode" type="string"
* @return String
*/
public String getAreacode() {
return areacode;
}
/**
* @hibernate.property column="bank_nam" type="string"
* @return String
*/
public String getBank_nam() {
return bank_nam;
}
/**
* @hibernate.property column="bmdm" type="string"
* @return String
*/
public String getBmdm() {
return bmdm;
}
/**
* @hibernate.property column="bmzdm" type="string"
* @return String
*/
public String getBmzdm() {
return bmzdm;
}
/**
* @hibernate.property column="bzhdm" type="string"
* @return String
*/
public String getBzhdm() {
return bzhdm;
}
/**
* @hibernate.property column="cbfs" type="char"
* @return Character
*/
public Character getCbfs() {
return cbfs;
}
/**
* @hibernate.property column="cleared" type="char"
* @return Character
*/
public Character getCleared() {
return cleared;
}
/**
* @hibernate.property column="del_date" type="date"
* @return Date
*/
public Date getDel_date() {
/* if (del_date != null)
hmap.put("del_date", new Long(del_date.getTime()));*/
return del_date;
}
/**
* @hibernate.property column="dlddm" type="string"
* @return String
*/
public String getDlddm() {
return dlddm;
}
/**
* @hibernate.property column="ec_natu" type="string"
* @return String
*/
public String getEc_natu() {
return ec_natu;
}
/**
* @hibernate.property column="edrno" type="string"
* @return String
*/
public String getEdrno() {
return edrno;
}
/**
* @hibernate.property column="email" type="string"
* @return String
*/
public String getEmail() {
return email;
}
/**
* @hibernate.property column="end_date" type="date"
* @return Date
*/
public Date getEnd_date() {
/* if (end_date != null)
hmap.put("end_date", new Long(end_date.getTime()));*/
return end_date;
}
/**
* @hibernate.property column="fgs" type="string"
* @return String
*/
public String getFgs() {
return fgs;
}
/**
* @hibernate.property column="grade" type="char"
* @return Character
*/
public Character getGrade() {
return grade;
}
/**
* @hibernate.property column="hb_fgs" type="string"
* @return String
*/
public String getHb_fgs() {
return hb_fgs;
}
/**
* @hibernate.property column="hbrq" type="date"
* @return Date
*/
public Date getHbrq() {
/* if (hbrq != null)
hmap.put("hbrq", new Long(hbrq.getTime()));*/
return hbrq;
}
/**
* @hibernate.property column="hby" type="string"
* @return String
*/
public String getHby() {
return hby;
}
/**
* @hibernate.property column="insured" type="string"
* @return String
*/
public String getInsured() {
return insured;
}
/**
* @hibernate.property column="isnewver" type="short"
* @return Short
*/
public Short getIsnewver() {
return isnewver;
}
/**
* @hibernate.property column="isnumsdisc" type="short"
* @return Short
*/
public Short getIsnumsdisc() {
return isnumsdisc;
}
/**
* @hibernate.property column="issue_da" type="date"
* @return Date
*/
public Date getIssue_da() {
/* if (issue_da != null)
hmap.put("issue_da", new Long(issue_da.getTime()));*/
return issue_da;
}
/**
* @hibernate.property column="kh_no" type="string"
* @return String
*/
public String getKh_no() {
return kh_no;
}
/**
* @hibernate.property column="kshdm" type="string"
* @return String
*/
public String getKshdm() {
return kshdm;
}
/**
* @hibernate.property column="kz_end_date" type="date"
* @return Date
*/
public Date getKz_end_date() {
/* if (kz_end_date != null)
hmap.put("kz_end_date", new Long(kz_end_date.getTime()));*/
return kz_end_date;
}
/**
* @hibernate.property column="kz_start_da" type="date"
* @return Date
*/
public Date getKz_start_da() {
/* if (kz_start_da != null)
hmap.put("kz_start_da", new Long(kz_start_da.getTime()));*/
return kz_start_da;
}
/**
* @hibernate.property column="last_t_date" type="date"
* @return Date
*/
public Date getLast_t_date() {
/* if (last_t_date != null)
hmap.put("last_t_date", new Long(last_t_date.getTime()));*/
return last_t_date;
}
/**
* @hibernate.property column="last_u_date" type="date"
* @return Date
*/
public Date getLast_u_date() {
/* if (last_u_date != null)
hmap.put("last_u_date", new Long(last_u_date.getTime()));*/
return last_u_date;
}
/**
* @hibernate.property column="lia_addr" type="string"
* @return String
*/
public String getLia_addr() {
return lia_addr;
}
/**
* @hibernate.property column="liaison" type="string"
* @return String
*/
public String getLiaison() {
return liaison;
}
/**
* @hibernate.property column="lrfs" type="char"
* @return Character
*/
public Character getLrfs() {
return lrfs;
}
/**
* @hibernate.property column="lrrq" type="date"
* @return Date
*/
public Date getLrrq() {
/* if (lrrq != null)
hmap.put("lrrq", new Long(lrrq.getTime()));*/
return lrrq;
}
/**
* @hibernate.property column="mail_cod" type="string"
* @return String
*/
public String getMail_cod() {
return mail_cod;
}
/**
* @hibernate.property column="maker" type="string"
* @return String
*/
public String getMaker() {
return maker;
}
/**
* @hibernate.property column="neikou" type="char"
* @return Character
*/
public Character getNeikou() {
return neikou;
}
/**
* @hibernate.property column="nkje" type="double"
* @return Double
*/
public Double getNkje() {
return nkje;
}
/**
* @hibernate.property column="old_pno" type="string"
* @return String
*/
public String getOld_pno() {
return old_pno;
}
/**
* @hibernate.property column="operator" type="string"
* @return String
*/
public String getOperator() {
return operator;
}
/**
* @hibernate.property column="org_num" type="string"
* @return String
*/
public String getOrg_num() {
return org_num;
}
/**
* @hibernate.property column="p_count" type="short"
* @return Short
*/
public Short getP_count() {
return p_count;
}
/**
* @hibernate.id generator-class="assigned" type="string"
* column="p_no"
* @return
*/
public String getP_no() {
return p_no;
}
/**
* @hibernate.property column="pay_way" type="short"
* @return Short
*/
public Short getPay_way() {
return pay_way;
}
/**
* @hibernate.property column="plc_no" type="string"
* @return String
*/
public String getPlc_no() {
return plc_no;
}
/**
* @hibernate.property column="pol_kind" type="char"
* @return Character
*/
public Character getPol_kind() {
return pol_kind;
}
/**
* @hibernate.property column="pre_tot_veh" type="short"
* @return Short
*/
public Short getPre_tot_veh() {
return pre_tot_veh;
}
/**
* @hibernate.property column="printer" type="string"
* @return String
*/
public String getPrinter() {
return printer;
}
/**
* @hibernate.property column="printno" type="string"
* @return String
*/
public String getPrintno() {
return printno;
}
/**
* @hibernate.property column="printnums" type="short"
* @return Short
*/
public Short getPrintnums() {
return printnums;
}
/**
* @hibernate.property column="prop_da" type="date"
* @return Long
*/
public Date getProp_da() {
/* if (prop_da != null)
hmap.put("prop_da", new Long(prop_da.getTime()));*/
//return new Long(prop_da.getTime());
return prop_da;
}
/**
* @hibernate.property column="renew_years" type="short"
* @return Short
*/
public Short getRenew_years() {
return renew_years;
}
/**
* @hibernate.property column="renewed" type="char"
* @return Character
*/
public Character getRenewed() {
return renewed;
}
/**
* @hibernate.property column="risk_count" type="short"
* @return Short
*/
public Short getRisk_count() {
return risk_count;
}
/**
* @hibernate.property column="start_da" type="date"
* @return Date
*/
public Date getStart_da() {
/* if (start_da != null)
hmap.put("start_da", new Long(start_da.getTime()));*/
return start_da;
}
/**
* @hibernate.property column="sttldate" type="date"
* @return Date
*/
public Date getSttldate() {
/*if (sttldate != null)
hmap.put("sttldate", new Long(sttldate.getTime()));*/
return sttldate;
}
/**
* @hibernate.property column="sum_pre" type="double"
* @return Double
*/
public Double getSum_pre() {
return sum_pre;
}
/**
* @hibernate.property column="tele_no" type="string"
* @return String
*/
public String getTele_no() {
return tele_no;
}
/**
* @hibernate.property column="timerate" type="double"
* @return Double
*/
public Double getTimerate() {
return timerate;
}
/**
* @hibernate.property column="tot_fhje" type="double"
* @return Double
*/
public Double getTot_fhje() {
return tot_fhje;
}
/**
* @hibernate.property column="tot_md" type="short"
* @return Short
*/
public Short getTot_md() {
return tot_md;
}
/**
* @hibernate.property column="tot_pre" type="double"
* @return Double
*/
public Double getTot_pre() {
return tot_pre;
}
/**
* @hibernate.property column="tot_sum" type="double"
* @return Double
*/
public Double getTot_sum() {
return tot_sum;
}
/**
* @hibernate.property column="tot_veh" type="short"
* @return Short
*/
public Short getTot_veh() {
return tot_veh;
}
/**
* @hibernate.property column="urb_rur" type="string"
* @return String
*/
public String getUrb_rur() {
return urb_rur;
}
/**
* @hibernate.property column="verifier" type="string"
* @return String
*/
public String getVerifier() {
return verifier;
}
/**
* @hibernate.property column="xyh" type="string"
* @return String
*/
public String getXyh() {
return xyh;
}
/**
* @hibernate.property column="xykh" type="string"
* @return String
*/
public String getXykh() {
return xykh;
}
/**
* @hibernate.property column="xzhdm" type="string"
* @return String
*/
public String getXzhdm() {
return xzhdm;
}
/**
* @hibernate.property column="year_tot_fhje" type="double"
* @return Double
*/
public Double getYear_tot_fhje() {
return year_tot_fhje;
}
/**
* @hibernate.property column="year_tot_pre" type="double"
* @return Double
*/
public Double getYear_tot_pre() {
return year_tot_pre;
}
/**
* @hibernate.property column="zcjg" type="string"
* @return String
*/
public String getZcjg() {
return zcjg;
}
/**
* @hibernate.property column="zdzq" type="short"
* @return Short
*/
public Short getZdzq() {
return zdzq;
}
/**
* @hibernate.property column="zhcfsh" type="char"
* @return Character
*/
public Character getZhcfsh() {
return zhcfsh;
}
/**
* @hibernate.property column="zhfl" type="string"
* @return String
*/
public String getZhfl() {
return zhfl;
}
/**
* @hibernate.property column="zyfs" type="string"
* @return String
*/
public String getZyfs() {
return zyfs;
}
/**
* @param string
*/
public void setAcct_no(String string) {
acct_no = string;
}
/**
* @param double1
*/
public void setAct_pre(Double double1) {
act_pre = double1;
}
/**
* @param double1
*/
public void setAdj_pre(Double double1) {
adj_pre = double1;
}
/**
* @param double1
*/
public void setAdjratio(Double double1) {
adjratio = double1;
}
/**
* @param string
*/
public void setApl_email(String string) {
apl_email = string;
}
/**
* @param string
*/
public void setApl_liaison(String string) {
apl_liaison = string;
}
/**
* @param string
*/
public void setApl_mail_cod(String string) {
apl_mail_cod = string;
}
/**
* @param string
*/
public void setApl_tele_no(String string) {
apl_tele_no = string;
}
/**
* @param string
*/
public void setApplier(String string) {
applier = string;
}
/**
* @param string
*/
public void setAreacode(String string) {
areacode = string;
}
/**
* @param string
*/
public void setBank_nam(String string) {
bank_nam = string;
}
/**
* @param string
*/
public void setBmdm(String string) {
bmdm = string;
}
/**
* @param string
*/
public void setBmzdm(String string) {
bmzdm = string;
}
/**
* @param string
*/
public void setBzhdm(String string) {
bzhdm = string;
}
/**
* @param character
*/
public void setCbfs(Character character) {
cbfs = character;
}
/**
* @param character
*/
public void setCleared(Character character) {
cleared = character;
}
/**
* @param date
*/
public void setDel_date(Date date) {
del_date = date;
}
/**
* @param string
*/
public void setDlddm(String string) {
dlddm = string;
}
/**
* @param string
*/
public void setEc_natu(String string) {
ec_natu = string;
}
/**
* @param string
*/
public void setEdrno(String string) {
edrno = string;
}
/**
* @param string
*/
public void setEmail(String string) {
email = string;
}
/**
* @param date
*/
public void setEnd_date(Date date) {
end_date = date;
}
/**
* @param string
*/
public void setFgs(String string) {
fgs = string;
}
/**
* @param character
*/
public void setGrade(Character character) {
grade = character;
}
/**
* @param string
*/
public void setHb_fgs(String string) {
hb_fgs = string;
}
/**
* @param date
*/
public void setHbrq(Date date) {
hbrq = date;
}
/**
* @param string
*/
public void setHby(String string) {
hby = string;
}
/**
* @param string
*/
public void setInsured(String string) {
insured = string;
}
/**
* @param short1
*/
public void setIsnewver(Short short1) {
isnewver = short1;
}
/**
* @param short1
*/
public void setIsnumsdisc(Short short1) {
isnumsdisc = short1;
}
/**
* @param date
*/
public void setIssue_da(Date date) {
issue_da = date;
}
/**
* @param string
*/
public void setKh_no(String string) {
kh_no = string;
}
/**
* @param string
*/
public void setKshdm(String string) {
kshdm = string;
}
/**
* @param date
*/
public void setKz_end_date(Date date) {
kz_end_date = date;
}
/**
* @param date
*/
public void setKz_start_da(Date date) {
kz_start_da = date;
}
/**
* @param date
*/
public void setLast_t_date(Date date) {
last_t_date = date;
}
/**
* @param date
*/
public void setLast_u_date(Date date) {
last_u_date = date;
}
/**
* @param string
*/
public void setLia_addr(String string) {
lia_addr = string;
}
/**
* @param string
*/
public void setLiaison(String string) {
liaison = string;
}
/**
* @param character
*/
public void setLrfs(Character character) {
lrfs = character;
}
/**
* @param date
*/
public void setLrrq(Date date) {
lrrq = date;
}
/**
* @param string
*/
public void setMail_cod(String string) {
mail_cod = string;
}
/**
* @param string
*/
public void setMaker(String string) {
maker = string;
}
/**
* @param character
*/
public void setNeikou(Character character) {
neikou = character;
}
/**
* @param double1
*/
public void setNkje(Double double1) {
nkje = double1;
}
/**
* @param string
*/
public void setOld_pno(String string) {
old_pno = string;
}
/**
* @param string
*/
public void setOperator(String string) {
operator = string;
}
/**
* @param string
*/
public void setOrg_num(String string) {
org_num = string;
}
/**
* @param short1
*/
public void setP_count(Short short1) {
p_count = short1;
}
/**
* @param string
*/
public void setP_no(String string) {
p_no = string;
}
/**
* @param short1
*/
public void setPay_way(Short short1) {
pay_way = short1;
}
/**
* @param string
*/
public void setPlc_no(String string) {
plc_no = string;
}
/**
* @param character
*/
public void setPol_kind(Character character) {
pol_kind = character;
}
/**
* @param short1
*/
public void setPre_tot_veh(Short short1) {
pre_tot_veh = short1;
}
/**
* @param string
*/
public void setPrinter(String string) {
printer = string;
}
/**
* @param string
*/
public void setPrintno(String string) {
printno = string;
}
/**
* @param short1
*/
public void setPrintnums(Short short1) {
printnums = short1;
}
/**
* @param date
*/
public void setProp_da(Date date) {
prop_da = date;
//prop_da = new java.sql.Date(((Long)hmap.get("prop_da")).longValue());
//hmap.put("prop_da", new Long(prop_da.getTime()));
}
/**
* @param short1
*/
public void setRenew_years(Short short1) {
renew_years = short1;
}
/**
* @param character
*/
public void setRenewed(Character character) {
renewed = character;
}
/**
* @param short1
*/
public void setRisk_count(Short short1) {
risk_count = short1;
}
/**
* @param date
*/
public void setStart_da(Date date) {
start_da = date;
}
/**
* @param date
*/
public void setSttldate(Date date) {
sttldate = date;
}
/**
* @param double1
*/
public void setSum_pre(Double double1) {
sum_pre = double1;
}
/**
* @param string
*/
public void setTele_no(String string) {
tele_no = string;
}
/**
* @param double1
*/
public void setTimerate(Double double1) {
timerate = double1;
}
/**
* @param double1
*/
public void setTot_fhje(Double double1) {
tot_fhje = double1;
}
/**
* @param short1
*/
public void setTot_md(Short short1) {
tot_md = short1;
}
/**
* @param double1
*/
public void setTot_pre(Double double1) {
tot_pre = double1;
}
/**
* @param double1
*/
public void setTot_sum(Double double1) {
tot_sum = double1;
}
/**
* @param short1
*/
public void setTot_veh(Short short1) {
tot_veh = short1;
}
/**
* @param string
*/
public void setUrb_rur(String string) {
urb_rur = string;
}
/**
* @param string
*/
public void setVerifier(String string) {
verifier = string;
}
/**
* @param string
*/
public void setXyh(String string) {
xyh = string;
}
/**
* @param string
*/
public void setXykh(String string) {
xykh = string;
}
/**
* @param string
*/
public void setXzhdm(String string) {
xzhdm = string;
}
/**
* @param double1
*/
public void setYear_tot_fhje(Double double1) {
year_tot_fhje = double1;
}
/**
* @param double1
*/
public void setYear_tot_pre(Double double1) {
year_tot_pre = double1;
}
/**
* @param string
*/
public void setZcjg(String string) {
zcjg = string;
}
/**
* @param short1
*/
public void setZdzq(Short short1) {
zdzq = short1;
}
/**
* @param character
*/
public void setZhcfsh(Character character) {
zhcfsh = character;
}
/**
* @param string
*/
public void setZhfl(String string) {
zhfl = string;
}
/**
* @param string
*/
public void setZyfs(String string) {
zyfs = string;
}
/**
* @return
*/
public HashMap getHmap() {
String fieldTypeName;
Class myclass = this.getClass();
Field[] fields = myclass.getDeclaredFields();
for (int ctr = 0; ctr < fields.length; ctr++) {
//fields[ctr].setAccessible(true);
fieldTypeName = fields[ctr].getType().getName();
String fieldName = fields[ctr].getName();
// System.out.println("fieldName is: " + fieldName);
if (fieldTypeName.equals("java.util.Date")) {
try {
Date date = (Date) fields[ctr].get(this);
if (date != null)
hmap.put(fieldName, new Long(date.getTime()));
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
return hmap;
}
/**
* @param map
*/
public void setHmap(HashMap map) {
hmap = map;
}
/**
* @hibernate.property column="mobile" type="string"
* @return String
*/
public String getMobile() {
return mobile;
}
/**
* @hibernate.property column="mpje" type="double" length="12"
* @return Double
*/
public Double getMpje() {
return mpje;
}
/**
* @hibernate.property column="omnicard" type="string"
* @return String
*/
public String getOmnicard() {
return omnicard;
}
/**
* @hibernate.property column="tbdm" type="string"
* @return String
*/
public String getTbdm() {
return tbdm;
}
/**
* @param string
*/
public void setMobile(String string) {
mobile = string;
}
/**
* @param double1
*/
public void setMpje(Double double1) {
mpje = double1;
}
/**
* @param string
*/
public void setOmnicard(String string) {
omnicard = string;
}
/**
* @param string
*/
public void setTbdm(String string) {
tbdm = string;
}
[color=red]/**
* @hibernate.set
* readonly = "true"
* cascade="all"
* table="t_zxfd"
* outer-join="true"
* @hibernate.collection-key
* column="p_no"
* @hibernate.collection-one-to-many
* class="zxfd"
* @return
*/
public Set getZxfdSet() {
return zxfdSet;
}
/**
* @param set
*/
public void setZxfdSet(Set set) {
zxfdSet = set;
}[/color]
}
I use xdoclet to generate plc.hbm.xml file. Here it is.
plc.hbm.xml:Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="plc"
table="t_plc"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="p_no"
column="p_no"
type="string"
>
<generator class="assigned">
</generator>
</id>
<property
name="acct_no"
type="string"
update="true"
insert="true"
column="acct_no"
/>
<property
name="act_pre"
type="double"
update="true"
insert="true"
column="act_pre"
/>
<property
name="adj_pre"
type="double"
update="true"
insert="true"
column="adj_pre"
/>
<property
name="adjratio"
type="double"
update="true"
insert="true"
column="adjratio"
/>
<property
name="apl_email"
type="string"
update="true"
insert="true"
column="apl_email"
/>
<property
name="apl_liaison"
type="string"
update="true"
insert="true"
column="apl_liaison"
/>
<property
name="apl_mail_cod"
type="string"
update="true"
insert="true"
column="apl_mail_cod"
/>
<property
name="apl_tele_no"
type="string"
update="true"
insert="true"
column="apl_tele_no"
/>
<property
name="applier"
type="string"
update="true"
insert="true"
column="applier"
/>
<property
name="areacode"
type="string"
update="true"
insert="true"
column="areacode"
/>
<property
name="bank_nam"
type="string"
update="true"
insert="true"
column="bank_nam"
/>
<property
name="bmdm"
type="string"
update="true"
insert="true"
column="bmdm"
/>
<property
name="bmzdm"
type="string"
update="true"
insert="true"
column="bmzdm"
/>
<property
name="bzhdm"
type="string"
update="true"
insert="true"
column="bzhdm"
/>
<property
name="cbfs"
type="char"
update="true"
insert="true"
column="cbfs"
/>
<property
name="cleared"
type="char"
update="true"
insert="true"
column="cleared"
/>
<property
name="del_date"
type="date"
update="true"
insert="true"
column="del_date"
/>
<property
name="dlddm"
type="string"
update="true"
insert="true"
column="dlddm"
/>
<property
name="ec_natu"
type="string"
update="true"
insert="true"
column="ec_natu"
/>
<property
name="edrno"
type="string"
update="true"
insert="true"
column="edrno"
/>
<property
name="email"
type="string"
update="true"
insert="true"
column="email"
/>
<property
name="end_date"
type="date"
update="true"
insert="true"
column="end_date"
/>
<property
name="fgs"
type="string"
update="true"
insert="true"
column="fgs"
/>
<property
name="grade"
type="char"
update="true"
insert="true"
column="grade"
/>
<property
name="hb_fgs"
type="string"
update="true"
insert="true"
column="hb_fgs"
/>
<property
name="hbrq"
type="date"
update="true"
insert="true"
column="hbrq"
/>
<property
name="hby"
type="string"
update="true"
insert="true"
column="hby"
/>
<property
name="insured"
type="string"
update="true"
insert="true"
column="insured"
/>
<property
name="isnewver"
type="short"
update="true"
insert="true"
column="isnewver"
/>
<property
name="isnumsdisc"
type="short"
update="true"
insert="true"
column="isnumsdisc"
/>
<property
name="issue_da"
type="date"
update="true"
insert="true"
column="issue_da"
/>
<property
name="kh_no"
type="string"
update="true"
insert="true"
column="kh_no"
/>
<property
name="kshdm"
type="string"
update="true"
insert="true"
column="kshdm"
/>
<property
name="kz_end_date"
type="date"
update="true"
insert="true"
column="kz_end_date"
/>
<property
name="kz_start_da"
type="date"
update="true"
insert="true"
column="kz_start_da"
/>
<property
name="last_t_date"
type="date"
update="true"
insert="true"
column="last_t_date"
/>
<property
name="last_u_date"
type="date"
update="true"
insert="true"
column="last_u_date"
/>
<property
name="lia_addr"
type="string"
update="true"
insert="true"
column="lia_addr"
/>
<property
name="liaison"
type="string"
update="true"
insert="true"
column="liaison"
/>
<property
name="lrfs"
type="char"
update="true"
insert="true"
column="lrfs"
/>
<property
name="lrrq"
type="date"
update="true"
insert="true"
column="lrrq"
/>
<property
name="mail_cod"
type="string"
update="true"
insert="true"
column="mail_cod"
/>
<property
name="maker"
type="string"
update="true"
insert="true"
column="maker"
/>
<property
name="neikou"
type="char"
update="true"
insert="true"
column="neikou"
/>
<property
name="nkje"
type="double"
update="true"
insert="true"
column="nkje"
/>
<property
name="old_pno"
type="string"
update="true"
insert="true"
column="old_pno"
/>
<property
name="operator"
type="string"
update="true"
insert="true"
column="operator"
/>
<property
name="org_num"
type="string"
update="true"
insert="true"
column="org_num"
/>
<property
name="p_count"
type="short"
update="true"
insert="true"
column="p_count"
/>
<property
name="pay_way"
type="short"
update="true"
insert="true"
column="pay_way"
/>
<property
name="plc_no"
type="string"
update="true"
insert="true"
column="plc_no"
/>
<property
name="pol_kind"
type="char"
update="true"
insert="true"
column="pol_kind"
/>
<property
name="pre_tot_veh"
type="short"
update="true"
insert="true"
column="pre_tot_veh"
/>
<property
name="printer"
type="string"
update="true"
insert="true"
column="printer"
/>
<property
name="printno"
type="string"
update="true"
insert="true"
column="printno"
/>
<property
name="printnums"
type="short"
update="true"
insert="true"
column="printnums"
/>
<property
name="prop_da"
type="date"
update="true"
insert="true"
column="prop_da"
/>
<property
name="renew_years"
type="short"
update="true"
insert="true"
column="renew_years"
/>
<property
name="renewed"
type="char"
update="true"
insert="true"
column="renewed"
/>
<property
name="risk_count"
type="short"
update="true"
insert="true"
column="risk_count"
/>
<property
name="start_da"
type="date"
update="true"
insert="true"
column="start_da"
/>
<property
name="sttldate"
type="date"
update="true"
insert="true"
column="sttldate"
/>
<property
name="sum_pre"
type="double"
update="true"
insert="true"
column="sum_pre"
/>
<property
name="tele_no"
type="string"
update="true"
insert="true"
column="tele_no"
/>
<property
name="timerate"
type="double"
update="true"
insert="true"
column="timerate"
/>
<property
name="tot_fhje"
type="double"
update="true"
insert="true"
column="tot_fhje"
/>
<property
name="tot_md"
type="short"
update="true"
insert="true"
column="tot_md"
/>
<property
name="tot_pre"
type="double"
update="true"
insert="true"
column="tot_pre"
/>
<property
name="tot_sum"
type="double"
update="true"
insert="true"
column="tot_sum"
/>
<property
name="tot_veh"
type="short"
update="true"
insert="true"
column="tot_veh"
/>
<property
name="urb_rur"
type="string"
update="true"
insert="true"
column="urb_rur"
/>
<property
name="verifier"
type="string"
update="true"
insert="true"
column="verifier"
/>
<property
name="xyh"
type="string"
update="true"
insert="true"
column="xyh"
/>
<property
name="xykh"
type="string"
update="true"
insert="true"
column="xykh"
/>
<property
name="xzhdm"
type="string"
update="true"
insert="true"
column="xzhdm"
/>
<property
name="year_tot_fhje"
type="double"
update="true"
insert="true"
column="year_tot_fhje"
/>
<property
name="year_tot_pre"
type="double"
update="true"
insert="true"
column="year_tot_pre"
/>
<property
name="zcjg"
type="string"
update="true"
insert="true"
column="zcjg"
/>
<property
name="zdzq"
type="short"
update="true"
insert="true"
column="zdzq"
/>
<property
name="zhcfsh"
type="char"
update="true"
insert="true"
column="zhcfsh"
/>
<property
name="zhfl"
type="string"
update="true"
insert="true"
column="zhfl"
/>
<property
name="zyfs"
type="string"
update="true"
insert="true"
column="zyfs"
/>
<property
name="mobile"
type="string"
update="true"
insert="true"
column="mobile"
/>
<property
name="mpje"
type="double"
update="true"
insert="true"
column="mpje"
length="12"
/>
<property
name="omnicard"
type="string"
update="true"
insert="true"
column="omnicard"
/>
<property
name="tbdm"
type="string"
update="true"
insert="true"
column="tbdm"
/>
<set
name="zxfdSet"
table="t_zxfd"
lazy="false"
inverse="false"
cascade="all"
sort="unsorted"
>
<key
column="p_no"
/>
<one-to-many
class="zxfd"
/>
</set>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-plc.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
and zxfd.java is:
Code:
/*
* Created on 2004-2-2
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
/**
* @author Administrator
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
//import java.util.*;
import java.io.*;
//import java.lang.reflect.*;
/**
* @hibernate.class table="t_zxfd"
*
* @author Yingzi Jin
*
* Represents a t_zxfd
*/
public class zxfd implements Serializable{
private String p_no;// char(20) no
private String fgs;// char(7) no
private Short vehno;// smallint yes
private String edrno;// char(20) no
private String xzhdm;// char(8) no
private String fdx;// char(8) yes
private Short calctype;// smallint yes
private Double adjamt;// decimal(10,2) no
private Double adjratio;// decimal(12,8) yes
private String plc_no;// char(20)
/**
* @hibernate.property column="adjamt" type="double"
* @return double
*/
public Double getAdjamt() {
return adjamt;
}
/**
* @hibernate.property column="adjratio" type="double"
* @return double
*/
public Double getAdjratio() {
return adjratio;
}
/**
* @hibernate.property column="calctype" type="short"
* @return Short
*/
public Short getCalctype() {
return calctype;
}
/**
* @hibernate.property column="edrno" type="string"
* @return String
*/
public String getEdrno() {
return edrno;
}
/**
* @hibernate.property column="fdx" type="string"
* @return String
*/
public String getFdx() {
return fdx;
}
/**
* @hibernate.property column="fgs" type="string"
* @return String
*/
public String getFgs() {
return fgs;
}
/**
* @hibernate.id generator-class="assigned" type="string"
* column="p_no"
* @return
*/
public String getP_no() {
return p_no;
}
/**
* @hibernate.property column="plc_no" type="string"
* @return String
*/
public String getPlc_no() {
return plc_no;
}
/**
* @hibernate.property column="vehno" type="short"
* @return Short
*/
public Short getVehno() {
return vehno;
}
/**
* @hibernate.property column="xzhdm" type="string"
* @return String
*/
public String getXzhdm() {
return xzhdm;
}
/**
* @param double1
*/
public void setAdjamt(Double double1) {
adjamt = double1;
}
/**
* @param double1
*/
public void setAdjratio(Double double1) {
adjratio = double1;
}
/**
* @param short1
*/
public void setCalctype(Short short1) {
calctype = short1;
}
/**
* @param string
*/
public void setEdrno(String string) {
edrno = string;
}
/**
* @param string
*/
public void setFdx(String string) {
fdx = string;
}
/**
* @param string
*/
public void setFgs(String string) {
fgs = string;
}
/**
* @param string
*/
public void setP_no(String string) {
p_no = string;
}
/**
* @param string
*/
public void setPlc_no(String string) {
plc_no = string;
}
/**
* @param short1
*/
public void setVehno(Short short1) {
vehno = short1;
}
/**
* @param string
*/
public void setXzhdm(String string) {
xzhdm = string;
}
}
The zxfd.hbm.xml is:
[code]<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="zxfd"
table="t_zxfd"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="p_no"
column="p_no"
type="string"
>
<generator class="assigned">
</generator>
</id>
<property
name="adjamt"
type="double"
update="true"
ins