先写上我的2个java代码:第一个(这是一方的):
public class CustomBean implements Serializable {
private String id;
private String cardid;
private String cardtype;
private String name;
private String sex;
private String contactname;
private String contacttel;
private String addre;
private Set bookbean = new HashSet(); public String getAddre() {
return addre;
}
public void setAddre(String addre) {
this.addre = addre;
}
public String getCardid() {
return cardid;
}
public void setCardid(String cardid) {
this.cardid = cardid;
}
public String getCardtype() {
return cardtype;
}
public void setCardtype(String cardtype) {
this.cardtype = cardtype;
}
public String getContactname() {
return contactname;
}
public void setContactname(String contactname) {
this.contactname = contactname;
}
public String getContacttel() {
return contacttel;
}
public void setContacttel(String contacttel) {
this.contacttel = contacttel;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Set getBookbean() {
return bookbean;
}
public void setBookbean(Set bookbean) {
this.bookbean = bookbean;
}}第2个(这是多方的):
public class BookBean implements Serializable {

private String flightid;
private String flightcardid;
private String sittype;
private String eattype;
private double sumprice;
private Date bookdate;
private String other;
private CustomBean custombean;

private Set flightmessage = new HashSet();

public Date getBookdate() {
return bookdate;
}
public void setBookdate(Date bookdate) {
this.bookdate = bookdate;
} public String getEattype() {
return eattype;
}
public void setEattype(String eattype) {
this.eattype = eattype;
}
public String getFlightcardid() {
return flightcardid;
}
public void setFlightcardid(String flightcardid) {
this.flightcardid = flightcardid;
}
public String getFlightid() {
return flightid;
}
public void setFlightid(String flightid) {
this.flightid = flightid;
}
public String getOther() {
return other;
}
public void setOther(String other) {
this.other = other;
}
public String getSittype() {
return sittype;
}
public void setSittype(String sittype) {
this.sittype = sittype;
}
public double getSumprice() {
return sumprice;
}
public void setSumprice(double sumprice) {
this.sumprice = sumprice;
}
public CustomBean getCustombean() {
return custombean;
}
public void setCustombean(CustomBean custombean) {
this.custombean = custombean;
}
public Set getFlightmessage() {
return flightmessage;
}
public void setFlightmessage(Set flightmessage) {
this.flightmessage = flightmessage;
}
}下面是配置:第一个: <hibernate-mapping>
<class name="airlines_bean.CustomBean">
<id name="cardid" column="cardid"></id>
<property name="cardtype" column="cardtype" type="string" length="20" not-null="true"/>
<property name="name" column="name" type="string" length="20" not-null="true"/>
<property name="sex" column="sex" type="string" length="5" not-null="true"/>
<property name="contactname" column="contactname" type="string" not-null="true"/>
<property name="contacttel" column="contacttel" type="string" not-null="true"/>
<property name="addre" column="addre" type="string" not-null="true"/>
<set name="bookbean">
<key>
<column name="cardid"/>
</key>
<one-to-many class="airlines_bean.BookBean"/>
</set>
</class>
</hibernate-mapping>第2个: <hibernate-mapping>
<class name="airlines_bean.BookBean">
<id name="flightid" type="String">
<column name="flightid"/>
</id>
<property name="flightcardid" column="flightcardid" length="30" type="String" not-null="true"/>
<property name="sittype" column="sittype" length="20" type="String" not-null="true"/>
<property name="eattype" column="eattype" length="20" type="String" not-null="true"/>
<property name="sumprice" column="sumprice" type="double" not-null="true"/>
<property name="bookdate" column="bookdate" type="date" not-null="true"/>
<property name="other" column="other" type="String" not-null="true"/>
<many-to-one name="custombean" class="airlines_bean.CustomBean" column="cardid" cascade="all"/>
</class>
</hibernate-mapping>
问题是在<one-to-many class="airlines_bean.BookBean"/>和<many-to-one name="custombean" class="airlines_bean.CustomBean" column="cardid" cascade="all"/>出现了问题,说bean文件没有被实例化或是不存在.不知道怎么解决,麻烦各位前辈教教.page没有错误!拜托了!