In the past two days, I'm studying one-to-one and one-to-many of Hibernate, and many trials have been made, when implementing the formal relationship, the class of generator in hibernate-maping is set to uiD.HEX, the above Two relationships can be implemented, that is, the primary key of the database is VARCHAR (MSSQL2000), but the primary key is changed to the INT type ID but pop-up "Error SessionImpl: 2379 - Could Not Synchronize Database State with session" and "net.sf.hibernate." HibernateException: SQL INSERT, UPDATE OR DELETE FAILED (ROW NOT FOUND "exception, Best can't understand. The primary key is set to UUID.HEX as uUid.HEX: Child.hbm.xml XML Version = "1.0"?>
Package test.pojo;
Public class child {private cname; private string pid; private string cid; public child () {} PUBLIC CHILD () {}
Public string getCID () {return CID;
Public void setcid (string CID) {this.cid = CID;
Public string getcname () {return cname;}
Public void setcname (string cname) {this.cname = cname;
Public string getpid () {return pid;}
Public void setpid (string pid) {this.pid = PID;
Public Parent getParent () {Return Parent;
Public void setparent (PARENT PARENT) {this.parent = Parent;}} Parent.hbm.xml xml version = "1.0"?>
Public class parent {private pName; private java.util.set child = new hashset (); private string pid; public parent () {}
Public string getpid () {return pid;}
Public void setpid (string pid) {this.pid = PID;
Public string getpname () {return pname;}
Public void setpname (string pname) {this.pname = PNAME;}
Public java.util.set getChild () {returnch;
Public void setchild (java.util.set child) {this.child = child;}
TestHibernate.javaPackage Test.pojo;
Public class testHibernate {public testhibernate () {}