Knowledge of Hibernate paging query

criteria.setProjection (null); purpose is to obtain the number of rows, and the projection set is empty, in order to return List out, if not set setProjection (null) words, criteria.list is the number of returns (int type) line, the database information is not to be queried. But Criteria of ResultTransformer become PassThroughResultTransformer, criteria.list when the results might not like ideal, so we still have to criteria.setResultTransformer (Criteria.ROOT_ENTITY); the result is returned in the form of Entity, not Object [] .

Guess you like

Origin www.cnblogs.com/jaynessvip/p/12167979.html