Hibernate Transformers aliasToBean for HQL and SQL

Hibernate 3.2: Transformers for HQL and SQL:
http://swik.net/Hibernate/Hibernate+GroupBlog/Hibernate+3.2:+Transformers+for+HQL+and+SQL/cmxs
引用
待读



啥也不说了,真好用啊。
String sql = "select r.id as id,r.account_name as accountName,r.name as name from T_REGIINFO r where DEL_STATUS='0' and IS_ADMIN='1' ORDER BY CONVERT (NAME USING gbk) ASC";
		return this.getHibernateGenericController().getSessionFactory()
				.getCurrentSession().createSQLQuery(sql).setResultTransformer(Transformers.aliasToBean(UserInfo.class)).list();

你可能感兴趣的:(java,sql)