日期:2014-05-18 浏览次数:20689 次
AccountTable account = (AccountTable) request.getSession() .getAttribute("accountInfo"); flag = crmDao.getBusinessByName((String) f.get("bsname"),account); JzBusiness business = null; String bsid = request.getParameter("bsid"); if (bsid != null) { business = crmDao.getJzBusiness(bsid); boolean s = !business.getBsname().equals((String) f.get("bsname")); if (!business.getBsname().equals((String) f.get("bsname"))) { if (flag) { request.setAttribute("errormessage", "业务已经存在!"); return mapping.findForward("businessexit"); } } } else { if (flag) { request.setAttribute("errormessage", "业务已经存在!"); return mapping.findForward("businessexit"); } business = new JzBusiness(); } business.setBsname((String) f.get("bsname")); business.setComments((String) f.get("comment")); int type = Integer.parseInt((String) f.get("remindtype")); business.setRemindtype(type); business.setAccountTable(account); crmDao.addBusiness(business);
<hibernate-mapping> <class name="cn.qdrk.strive.model.JzBusiness" table="jz_business"> <cache usage="read-write"/> <id name="bsId" type="java.lang.Integer"> <column name="bs_id" /> <generator class="native"></generator> </id> <many-to-one name="accountTable" class="cn.qdrk.strive.model.AccountTable" fetch="select"> <column name="account_id" /> </many-to-one> <property name="bsname" type="java.lang.String"> <column name="bsname" length="150" not-null="true" /> </property> <property name="comments" type="java.lang.String"> <column name="comments" length="200" /> </property> <property name="remindtype" type="java.lang.Integer"> <column name="remindtype" /> </property> <set name="jzKmessages" inverse="true"> <key> <column name="bs_id" /> </key> <one-to-many class="cn.qdrk.strive.model.JzKmessage" /> </set> </class> </hibernate-mapping>
Caused by: org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update Caused by: java.sql.BatchUpdateException: Unknown column 'bsname' in 'f