I am using hibernate criteria query to get data for my
AjaxFallbackDefaultDataTable, this datatable also gives me pagination
parameters which I am apply to criteria. .The entity I am using for the
criteria query has a lazy load collection ,and I need the size of the
collection in the view , so If I donot eager fetch collection I end up
with n+1 selects .So to eager fetch collection and not to have duplicater
records I added result transformer Criteria.DISTINCT_ROOT_ENTITY anmd
fetchmode join .
Now the problem is with pagination ,
for example I have item and bids and the criteria query to fetch items with
eager fetch for bids , suppose query selects one item and this item has
2 bids the query returns total 3 records and total record count will be 3
and now when I apply result transformer three records will reduce to one
record , but pagination information will be wrong , please help me how to
resolve this ?