package com.kk.mypackage;
@Repository
@Transactional public class DBConnectionCredit implements DBConnectionCreditInt {
@Autowired
private LocalSessionFactoryBean sessionFactory;
@Override
public void insertEmailSaveRequest(EmailSaveRequest emailSaveRequest)
{
try
{
StringBuilder sbCover=new StringBuilder();
sbCover.append("UPDATE QCIB_EMAIL_SAVE_REQ SET ");
sbCover.append("CORELATIONID='12345' ");
sbCover.append(" WHERE SID='412'");
int i=sessionFactory.getObject().getCurrentSession().createSQLQuery(sbCover.toString()).executeUpdate();
System.out.println(" i= "+i+" data saved : "+sbCover);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
控制台:
Hibernate: UPDATE QCIB_EMAIL_SAVE_REQ SET CORELATIONID='12345' WHERE SID='412'
i= 0 data saved : UPDATE QCIB_EMAIL_SAVE_REQ SET CORELATIONID='12345' WHERE SID='412'
答案 0 :(得分:-1)