只有这句clientuser.addCustomer(customer);和这两句clientuser.addCustomer(customer);
clientuser.addAccount(acc);一起出现的错误如下:Exception in thread "main" org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch updateat springexample.hibernate.TestClient.main(TestClient.java:39)Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch updateCaused by: java.sql.BatchUpdateException: ORA-00001: 违反唯一约束条件 (UNISPOWER.SYS_C0011001)不是唯一约束的问题,应该是相关属性外键关联的空置问题……未知????只有这句clientuser.addAccount(acc);的错误:Exception in thread "main" org.springframework.dao.DataIntegrityViolationException: not-null property references a null or transient value: springexample.hibernate.Account.customer; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value: springexample.hibernate.Account.customer at springexample.hibernate.TestClient.main(TestClient.java:40)Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: springexample.hibernate.Account.customer根据后面语句执行推断,上面的错误,问题可能在于,程序获得RMI服务bean的时候,set过的数据已经存到表中,再执行addXX方法肯定就不合唯一约束了。注意getHibernateTemplate().find()的用法,格式不对害死人啊!写了一个格式不太对的查询,
貌似程序现在还处于死循环状态……等待中ing