`
TreasureNow
  • 浏览: 20762 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
社区版块
存档分类
最新评论
文章列表
BeanUtils.setProperty 简单用法   public void getOverTime() throws Exception{ Session session = getHibernateTemplate().getSessionFactory().getCurrentSession(); Query query = session.createSQLQuery("select distinct(workid) workid from work"); List<BigInteger> list = query.list ...
1. getHibernateTemplate().getSessionFactory().createSQLQuery(insersql).executeUpdate() 直接写 sql 语句进行数据存储。 2. getHibernateTemplate().find(hql); 进行查询 public List findAll() throws Exception { log.debug("finding all User instances"); try { String queryString = "from User" ...
多的一方 xml 配置 <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Mapping file autogenerated by MyEclip ...

spring 事物配置

private UserDAO userDAO; public void setUserDAO(UserDAO userDAO) { this.userDAO = userDAO; } /** * 异常只有抛出事物才有回滚机制 */ public void saveUser(User user) throws Exception{ userDAO.save(user); }   public void save(User transientInstance) throws Exception { log.debug(" ...
Global site tag (gtag.js) - Google Analytics