public void validateDkkh() { Session session = HibernateSessionFactory.getSession(); String hql1 = "from Ln001 as l01 where l01.APPRNUM=?"; Query q1 = session.createQuery(hql1); q1.setString(0, l001.getAPPRNUM()); if ("".equals(l001.getAPPRNUM())) { this.addFieldError("dk1", "此处信息不可以为空"); } else if (q1.list().size() <= 0) { this.addFieldError("dk1", "此处信息无效"); } }
public String dkkh1() { ActionContext ac = ActionContext.getContext(); Map sess = ac.getSession(); Ln001 l02 = (Ln001) sess.get("l01"); l005.setAPPRNUM(l02.getAPPRNUM()); l005.setAGENCYBANK(l02.getAGENCYBANK()); l005.setACCTYPE("1"); if (l02.getRETLOANCYCLE().equals("1")) { l005.setCURDAYBAL(hs.Debj(l02.getAPPRLOANSUM(), l02.getAPPRLOANTERM(), l005.getCURRATE())); } else { l005.setCURDAYBAL(hs.Debx(l02.getAPPRLOANSUM(), l02.getAPPRLOANTERM(), l005.getCURRATE())); } Date d = new Date(); // SimpleDateFormat sd=new SimpleDateFormat("yyyy-MM-dd"); l005.setBEGININTDATE(new java.sql.Date(d.getTime())); org.hibernate.Session session = HibernateSessionFactory.getSession(); session.save(l005); Transaction t = session.beginTransaction(); try { t.commit(); HibernateSessionFactory.closeSession(); return "success"; } catch (Exception e) { // TODO: handle exception System.out.println(e); HibernateSessionFactory.closeSession(); return "break1"; } }
public String dkkh() { Session session = HibernateSessionFactory.getSession(); String hql1 = "from Ln001 as l01 where l01.APPRNUM=?"; Query q1 = session.createQuery(hql1); q1.setString(0, l001.getAPPRNUM()); l001 = (Ln001) q1.list().get(0); ActionContext ac = ActionContext.getContext(); Map sess = ac.getSession(); sess.put("l01", (Ln001) q1.list().get(0)); return "success"; }