Why am I getting org.hibernate.id.IdentifierGenerationException?
问题 As I run my main class (Runner) program I get the following exception : org.hibernate.id.IdentifierGenerationException: attempted to assign id from null one-to-one property: country I don't know the reason, why am I getting this exception. The mapping xml : <hibernate-mapping> <class name="pojo.Country" table="country"> <id name="countryID" column="c_id"> <generator class="increment" /> </id> <property name="countryName" column="c_name" /> <one-to-one class="pojo.PM" name="pm" cascade="all" /