Help

Andy Glover wrote an excellent article about Hibernate Shards a few weeks ago. (It seems we missed linking to it here.)

3 comments:
13. Oct 2010, 06:38 CET | Link

It has not been updated for ages. Is it still in active development?

ReplyQuote
18. May 2011, 10:23 CET | Link
zheng

hello,professor,when I use hibernate to find data in the database,my code as follow: Query query getSession().createQuery(hql); query.setFirstResult(firstResult); query.setMaxResults(rowCount); the hql is correct,when I use 'Query query getSession().createQuery(hql); ' I get 16 records, but when I use 'query.setFirstResult(firstResult); query.setMaxResults(rowCount);',the value of firstResult is 0,and the value of rowCountis is 16 ,but I just get 10 records,why?can you help me,thank you .

08. Feb 2012, 13:31 CET | Link

H4 ,How to get Out Parameters by calling stored procedure??? I cannot find infos from Hibernate Doc . Why???

What can I do ?

Session session = sessions.getCurrentSession();
Query query = session.getNamedQuery(storedProcedureName);

Above is right????? Help me ! I am eager...

-- --------------------------------------------------------------------------------
-- Routine DDL
-- Note: comments before and after the routine body will not be stored by the server
-- --------------------------------------------------------------------------------
DELIMITER $$

CREATE DEFINER=

root

@
%
 PROCEDURE 
QuerySoftware
(
IN PageSize SMALLINT,
IN PageNo int,
IN OrderBy varchar(1000),
OUT Total int
)
READS SQL DATA
COMMENT '分页存储过程,查询软件表.暂不做通用.'
BEGIN
DECLARE _where varchar(1000); 
-- 结束声明局部变量
-- --------------------------------
IF PageSize <= 1 OR PageSize >= 100 THEN SET PageSize = 15;
END IF;

IF PageNo < 1 THEN SET PageNo = 1;
END IF;

-- TODO
-- -------
SELECT COUNT(id) INTO Total 
FROM Software x;

SELECT 
Id,Name,ShortName,SoftwareVersion,Downloaded,UpdateId,Uuid,
PackageFilename,Md5,Size,HtmlDescription,Description,ShortDescription,
UpdateInfo,HtmlUpdateInfo,OsName,OsArchitecture,HomepageURL,
DownloadPageURL,DonwloadURL,Signs,Pattern,MatchType,UpdateDate,
UninstallName,ManualOrderPageNum,ManualOrderInPage,MainProgram,
UninstallProgram,SearchNames,HasPlugins,IsGreen,IsFree,IsBeta,
IsRecommended,IsHidden,IsPopping,CreateTime,CreateUser,LastEditUser,
LastEditTime,StatusId 
FROM Software x;
END

--------- MySQL

Post Comment