Hibernate Synchronizer下载地址:http://sourceforge.net/project/showfiles.php?group_id=99370 备份一下主键id映射: int native int primary key identity(1,1)String uuid.hex varchar(n)/char(n) primary keyint assigned int primary key//分页Criteria criteria = session.createCriteria(Article.class);criteria.setFirstResult(first);criteria.setFetchSize(recordsNum);//criteria.setMaxResults(recordsNum);//分组和统计criteria.setProjection(Projections.groupProperty("age"));//多条件的分组统计ProjectionList pList = Projections.projectionList();pList.add(Projections.groupProperty("age"));pList.add(Projections.rowCount());criteria.setProjection(pList);//排序criteria.addOrder(Order.desc("id"));criteria.addOrder(Order.asc("id"));