New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify distinct usage in API #303

Closed
timowest opened this Issue Nov 29, 2012 · 5 comments

Comments

Projects
None yet
4 participants
@timowest
Member

timowest commented Nov 29, 2012

countDistinct, iterateDistinct, listDistinct and listDistinctResults will be deprecated in Querydsl 3.0 and removed at a later time. This is because the same effect can be achieved with distinct() + count/iterate/list/listResults. This usage is more in line with other result modifiers such as limit, offset and orderBy.

As an example the following query

query.from(...).listDistinct(...)

can then be expressed as

query.from(...).distinct().list(...)

timowest added a commit that referenced this issue Nov 29, 2012

@netwein

This comment has been minimized.

Show comment
Hide comment
@netwein

netwein Jan 10, 2013

If the listDistinctResults will be removed how the funtionality of select distinct on specific field with pagination can be accomplished? Today the search result also calculates the total rows number on the distinct field

netwein commented Jan 10, 2013

If the listDistinctResults will be removed how the funtionality of select distinct on specific field with pagination can be accomplished? Today the search result also calculates the total rows number on the distinct field

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jan 10, 2013

Member

listDistinctResults(...) will become distinct().listResults(...)

Member

timowest commented Jan 10, 2013

listDistinctResults(...) will become distinct().listResults(...)

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jan 13, 2013

Member

Released in 3.0.0.BETA1

Member

timowest commented Jan 13, 2013

Released in 3.0.0.BETA1

@timowest timowest closed this Jan 13, 2013

@timowest timowest added this to the 3.0.0 milestone Apr 14, 2014

@hamavaro

This comment has been minimized.

Show comment
Hide comment
@hamavaro

hamavaro Feb 19, 2016

How Select DISTINCT on specific field can be done in querydsl 4.0.2 ?
Thanks.

hamavaro commented Feb 19, 2016

How Select DISTINCT on specific field can be done in querydsl 4.0.2 ?
Thanks.

@danielhiguerasgoold

This comment has been minimized.

Show comment
Hide comment
@danielhiguerasgoold

danielhiguerasgoold Jun 1, 2016

@hamavaro I think you are looking for the GROUP BY clause.

danielhiguerasgoold commented Jun 1, 2016

@hamavaro I think you are looking for the GROUP BY clause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment