※状况概述:
以下的程式,有City跟Country两个类别,city跟country是多对一的关系,
程式可以正常运作:
City类别:
public class City {
private int cityId;
private String cityName;
private Country country;
......
}
City的映射档:
<hibernate-mapping package="com.test.vo">
<class name="City" table="CITY">
<id name="cityId" column="CITY_ID">
<generator class="increment"/>
</id>
<property name="cityName" column="CITY_NAME" />
<many-to-one name="country" column="COUNTRY_ID" class="com.test.vo.Country"
cascade="all"/><!