Reputation: 125
i have two table with many to many relationship when i apply findbyall method to this table it will retrieve one record multiple time (that is the record will be displayed for this perticular table as many time as there are different relation ship with other table) so how can i display each record once only. thank in advance.
Upvotes: 0
Views: 885
Reputation: 17904
Add the 'distinct' transformer to your Criteria object, like so: crit.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
Upvotes: 1