tags:

views:

368

answers:

1

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.

+1  A: 

Add the 'distinct' transformer to your Criteria object, like so: crit.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);

Cuga