5.0.0 (22.7.2021)
This release of QueryDSL targets Java 8 minimally and comes with various improvements to make QueryDSL ready for the modern Java ecosystem.
This version also removes joda-time:joda-time
, com.google.guava:guava
and com.google.code.findbugs:jsr305
as required runtime dependencies for using QueryDSL.
QueryDSL 5.0 is the long awaited major release after the QueryDSL project was left mostly unmaintained for over two years. With this release the team worked hard on resolving the most pressing issues that have been requested repeatedly for a long time.
A huge thanks goes out to all contributors that made this release possible in their free time:
querydsl-sql
from joda-time:joda-time
;JPASQLQuery
;querydsl-collections
;querydsl-spatial
;HibernateDomainExporter
and JPADomainExporter
;Fetchable#stream()
which returns a Stream<T>
.
Make sure that the returned stream is always closed to free up resources, for example using try-with-resources.
It does not suffice to rely on a terminating operation on the stream for this (i.e. forEach
, collect
).joda-time:joda-time
is no longer a required dependency for querydsl-sql
.
By default, the Java 8 date/time API is used for date/time operations.
The joda-time:joda-time
types will still be registered automatically if they are on the classpath.com.querydsl.core.alias.Alias.*
to be used on a JRE by relying on ECJ as compilerJPAExpressions#treat
which can be used to generate JPA 2.1 Treated path expressions.querydsl-collections
.querydsl-spatial
HibernateDomainExporter
and JPADomainExporter
. jakarta
classifiers for Maven)nullif
and coalesce
methods.JPASQLQuery
Alias.*
. Alias.*
is now Thread safe.AbstractJPAQuery#fetchResults
and AbstractJPAQuery#fetchCount
in a query with a having clause by using an in-memory calculation.AbstractJPAQuery#fetchResults
and AbstractJPAQuery#fetchCount
in a query with multiple group by expressions by using an in-memory calculation.InsertClause
.TemplateFactory
.ExtendedBeanSerializer
from generating toString
method twiceJavaSE6SQLExceptionWrapper
and other parts regarding pre-Java 7 exception handling are removed. com.mysema.codegen
is now com.querydsl.codegen.utils
.
This for example affects com.mysema.codegen.model.SimpleType
.
Although many applications won't touch the codgen internal classes, custom APT extensions might be affected by this.ImmutableList
as parameter, now accepts any List
instead.
Normal code should handle this signature just fine.
However, make sure to check any reflective uses of these parameters.querydsl.variableNameFunctionClass
property for the DefaultConfiguration
should now be provided as a java.util.function.Function
instead of a com.google.common.base.Function
.CodeWriter#beginStaticMethod
now takes a java.util.function.Function
instead of a com.google.common.base.Function
.AbstractLuceneQuery
now takes a java.util.function.Function
instead of a com.google.common.base.Function
.AbstractMongodbQuery
now takes a java.util.function.Function
instead of a com.google.common.base.Function
.com.querydsl.codegen.NamingFunction
, EvaluatorFunction
, DefaultVariableFunction
now extend java.util.function.Function
instead of com.google.common.base.Function
.javax.inject.Provider
, now takes a java.util.function.Supplier
instead. In most cases you can replace the argument with provider::get
.HQLTemplates
instead of the Hibernate5Templates
.joda-time:joda-time
is now an optional dependency. If your application relies on joda-time:joda-time
make sure to specify it as a direct dependency rather than relying on QueryDSL to include it transitively.com.google.code.findbugs:jsr305
is no longer a dependency. If your application currently relies on QueryDSL shipping JSR305 transitively, you should add JSR305 as a direct dependency to your project.querydsl.query
now is querydsl_query
and querydsl.parameters
is querydsl_parameters
.PolyHedralSurface
in querydsl-spatial
and querydsl-sql-spatial
due to the upgrade of geolatte-geom
.com.querydsl.apt.Extension
moved to com.querydsl.codegen
and now resides in the querydsl-codegen
module.com.querydsl.apt.SpatialSupport
moved to com.querydsl.spatial.apt.SpatialSupport
and now resides in the querydsl-spatial
module.com.querydsl.sql.codegen.SpatialSupport
moved to com.querydsl.sql.spatial.SpatialSupport
and now resides in the querydsl-sql-spatial
module.SQLServerGeometryReader
in querydsl-sql-spatial
is removed in favour of org.geolatte.geom.codec.db.sqlserver.*
.PGgeometryConverter
in querydsl-sql-spatial
is removed in favour of org.geolatte.geom.codec.Wkt
.JGeometryConverter
in querydsl-sql-spatial
is removed in favour of org.geolatte.geom.codec.db.oracle.*
.HibernateDomainExporter
in querysql-jpa-codegen
. HibernateDomainExporter
only supported Hibernate 4, which QueryDSL no longer actively supports. Instead, use the JPADomainExporter
with Hibernate.ComparableExpression#coalesce
(and subtypes) no longer return a mutable Coalesce
expression, but instead return a typed expression.
If you need the Coalesce builder, use new Coalesce<T>().add(expression)
instead.getConstantToNamedLabel
, getConstantToNumberedLabel
and getConstantToAllLabels
that were temporarily introduced to SerializerBase
and JPQLSerializer
in QueryDSL 4.3.0 to eventually replace getConstantToLabel
are now removed in favor of getConstants
.AbstractJPAQuery#fetchResults
and AbstractJPAQuery#fetchCount
are now deprecated for queries that have multiple group by
expressions or a having clause, because these scenarios cannot be supported by pure JPA and are instead computed in-memory.
If the total count of results is not necessary, we recommend to always use AbstractJPAQuery#fetch
instead.
If you want a reliable way of computing the result count for a paginated result for even the most complicated queries,
we recommend using the Blaze-Persistence QueryDSL integration.
BlazeJPAQuery
properly implements both fetchResults
and fetchCount
and even comes with a page
method.getConstantToLabel
which was deprecated in QueryDSL 4.3.0 is no longer deprecated.cglib:cglib
to 3.3.0 for Java 8+ supportorg.eclipse.jdt.core.compiler:ecj
to 4.6.1 for Java 8+ supportjoda-time:joda-time
to 2.10.10 for better interoperability with other frameworks that use more recent versions than QueryDSL.
joda-time:joda-time
is also no longer a required dependency and as such is no longer provided transitively to your application.
If your application relies on joda-time:joda-time
being available, make sure to add the dependency to your project. org.geolatte:geolatte-geom
to 1.8.1 for better interopability with Hibernate Spatial.
querydsl-spatial
is still backwards compatible with older versions of Geolatte, however, querydsl-sql-spatial
is not and requires 1.4.0 or newer.com.vividsolutions:jts
to org.locationtech:jts
for better interopability with Hibernate Spatial.
com.vividsolutions:jts
is still supported for querydsl-spatial
if an older version of org.geolatte:geolatte-geom
is provided.org.datanucleus:javax.jdo
instead of javax.jdo:jdo-api
com.google.guava:guava
is no longer a dependency of QueryDSL and as such is no longer provided transitively to your application.
If your application relies on com.google.guava:guava
being available, make sure to add the dependency to your project.com.google.code.findbugs:jsr305
is no longer a dependency of QueryDSL and as such is no longer provided transitively to your application.
If your application relies on com.google.code.findbugs:jsr305
being available, make sure to add the dependency to your project.4.4.0 (20.9.2020)
4.3.1 (26.3.2020)
Restore compatibility for APT's DefaultConfiguration constructor (#2546)4.3.0 (13.3.2020)
4.2.2 (23.11.2019)
Dummy release (automated release pipeline).4.2.1 (22.3.2018)
4.2.0 (22.3.2018)
Replaced by 4.2.1 because of buggy release artifacts.4.1.4 (5.9.2016)
4.1.3 (30.6.2016)
4.1.2 (31.5.2016)
4.1.1 (16.5.2016)
4.1.0 (1.4.2016)
4.0.9 (29.2.2016)
4.0.8 (31.1.2016)
4.0.7 (30.11.2015)
4.0.6 (31.10.2015)
4.0.5 (1.10.2015)
4.0.4 (31.8.2015)
4.0.3 (31.7.2015)
4.0.2 (30.6.2015)
4.0.1 (31.5.2015)
4.0.0 (10.5.2015)
3.7.4 (30.6.2016)
3.7.3 (16.5.2016)
3.7.2 (29.2.2016)
3.7.1 (31.1.2016)
3.7.0 (30.11.2015)
3.6.9 (1.10.2015)
3.6.8 (1.10.2015)
3.6.7 (31.8.2015)
3.6.6 (31.7.2015)
3.6.5 (30.6.2015)
3.6.4 (31.5.2015)
3.6.3 (31.3.2015)
3.6.2 (28.2.2015)
3.6.1 (31.1.2015)
3.6.0 (30.11.2014)
3.5.1 (31.10.2014)
3.5.0 (30.9.2014)
3.4.3 (31.8.2014)
3.4.2 (29.7.2014)
3.4.1 (29.6.2014)
3.4.0 (9.6.2014)
3.3.4 (20.5.2014)
3.3.3 (2.5.2014)
3.3.2 (24.3.2014)
3.3.1 (8.2.2014)
3.3.0 (23.12.2013)
3.2.4 (20.10.2013)
3.2.3 (27.8.2013)
3.2.2 (29.7.2013)
3.2.1 (26.6.2013)
3.2.0 (27.5.2013)
3.1.1 (16.4.2013)
3.1.0 (27.3.2013)
3.0.0 (21.3.2013)
3.0.0.BETA2 (20.2.2013)
3.0.0.BETA1 (13.1.2013)
2.9.0 (19.11.2012)
2.8.2 (30.10.2012)
2.8.1 (19.10.2012)
2.8.0 (29.9.2012)
2.7.3 (10.9.2012)
2.7.2 (4.8.2012)
2.7.1 (17.7.2012)
2.7.0 (28.6.2012)
2.6.0 (25.5.2012)
2.5.0 (20.4.2012)
2.3.3 (11.3.2012)
2.3.2 (19.2.2012)
2.3.1 (7.2.2012)
2.3.0 (14.12.2011)
2.2.5 (19.11.2011)
2.2.4 (7.11.2011)
2.2.3 (27.9.2011)
2.2.2 (12.9.2011)
2.2.1 (10.8.2011)
2.2.0 (18.7.2011)
2.2.0.beta5
2.2.0-beta4
2.2.0-beta3
2.2.0-beta2
2.2.0-beta1
2.1.2 (22.2.2011)
2.1.1 (9.2.2011)
2.1.0 (3.2.2011)
2.1.0-beta3
2.1.0-beta2
2.1.0-beta1
2.0.9 (13.1.2011)
2.0.8 (3.1.2011)
2.0.7 (31.12.2010)
2.0.6 (17.12.2010)
2.0.5 (22.11.2010)
2.0.4 (10.11.2010)
2.0.3 (27.10.2010)
2.0.2 (13.10.2010)
2.0.1
2.0.0 (28.9.2010)
1.9.7
1.9.6
1.9.4
1.9.3
1.9.2
1.9.1
1.9.0
1.8.6
1.8.5
1.8.4
1.8.2
1.8.0