hibernate sql 操作
@SuppressWarnings("unchecked")
public List<ZxFunction> selectFunctionParentByUserId(final int userId) {
try {
final String sql = "select * from zx_function where f_id in ( select distinct f.f_parent_id from zx_function f,zx_permission p where p.f_id = f.f_id and p.u_id = ?)";
return (List<ZxFunction>) getHibernateTemplate().execute(new HibernateCallback(){
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
SQLQuery query = session.createSQLQuery(sql).addEntity(ZxFunction.class);
query.setInteger(0, 1);
return query.list();
}});
} catch (Exception e) {
CommonsLog4jUtil.printToConsole(e);
CommonsLog4jUtil.error("FunctionDaoImpl public List<UserFunction> selectFunctionParentByUserId() Error:", e);
return null;
}
}
@SuppressWarnings("unchecked")
public List<UserFunction> selectFunction(final int userId) {
try {
final String sql = "select f.f_id as FId,&q
相关文档:
SQL Server 2005 Express 导入/导出数据
安装好SQL Server 2005 Express后,再安装
http://download.microsoft.com/download/1/1/0/110d908f-c445-4523-b939-220c7d135f3d/SQLServer2005_SSMSEE.msi
就可以使用控制台进行数据库的管理。
但SQL Server Management Studio Express 并没有导入/导出数据的功能,我们可以 ......
三种SQL分页法效率分析
表中主键必须为标识列,[ID] int IDENTITY (1,1)
1.分页方案一:(利用Not In和SELECT TOP分页)
语句形式:利用Not In和SELECT TOP分页) 效率中,需要拼接SQL语句
SELECT TOP 10 * from TestTable WHERE (Id NOT IN (SELECT TOP 20 id&n ......
贺州市疾病预防控制中心所用的ZmSoft从业体检信息网络系统V2010.1.26 正式版采用SQL SERVER2000平台,不明原因,数据库"置疑“,客户试过所有网上方法,未能解决.沈阳凯文数据恢复中心SQL数据库工程师成功将其解决.
沈阳凯文数据恢复中心MS SQL SERVER研发小组致力于MsSql数据库技术的研究。经过多年研究完全掌握了S ......
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.Hibernat ......