Commit Graph

1944 Commits

Author SHA1 Message Date
Jan-Willem Gmelig Meyling
1c7def015b [#2366] Expose min/max on ComparableExpressoin(Base) 2021-01-24 16:39:46 +01:00
rob-valor
b7009c4529 [#2460] Allow alternative Generated annotation to be provided
Fixes #2460
Fixes #2612
Fixes #2242
Closes #2657

Co-authored-by: Jan-Willem Gmelig Meyling <jan-willem@youngmediaexperts.nl>
2021-01-18 10:19:07 +01:00
Jan-Willem Gmelig Meyling
ac7f855dda ResultTransformers for Guava collections
This pull request implements `ResultTransformers` for [Guava collection types](https://github.com/google/guava/wiki/CollectionUtilitiesExplained) (`Multimap`, `Table`, `BiMap`). The [`ResultTransformers`](http://www.querydsl.com/static/querydsl/latest/reference/html/ch03s02.html) form a fantastic API to project tuples to a composition of collections, most notably `Map` and `List`. However, deep nested `Maps` of `Lists` or `Maps` of  `Maps` can lead to superfluous and erroneous code. The Guava collection types help with this, for example: `Multimap` forms a fluent API around a `Map<K, Set<V>` and `Table<R, C, V>` is basically a two-dimensional `Map`. This pull request adds factory methods in `GuavaGroupBy` to construct `ResultTransformers` for these Guava collection types.
2021-01-03 17:54:35 +01:00
Jan-Willem Gmelig Meyling
78cd6ae97b
Merge pull request #2563 from jwgmeligmeyling/comparable-expression-inconsistency
Fix inconsistency between final and non-final methods in ComparableExpression, ComparableExpressionBase and SimpleExpression
2021-01-01 18:52:04 +01:00
Jan-Willem Gmelig Meyling
33dd19c855 [#2666] Clearer exception for using unsupported SQL Expressions in JPQL 2021-01-01 16:02:56 +01:00
Jan-Willem Gmelig Meyling
d9135b228a
Merge pull request #2605 from jwgmeligmeyling/issue/2053
[#2504] [#2053] Fix fetchResults for GROUP BY and HAVING in JPQL
2021-01-01 13:24:24 +01:00
Jan-Willem Gmelig Meyling
85c8e89934
Merge pull request #2707 from querydsl/i1941
Remove dots from MDC log fields.
2021-01-01 13:23:00 +01:00
Wyko Rijnsburger
2362416d26 Remove dots from MDC log fields. 2020-12-31 19:46:16 +01:00
Jan-Willem Gmelig Meyling
c75ef4cafd
Merge pull request #2530 from jwgmeligmeyling/jpa-treated-path
[#658] Support JPQL Treated paths for WHERE clause
2020-12-31 19:45:05 +01:00
Jan-Willem Gmelig Meyling
942812f7a3
Merge pull request #2706 from querydsl/memory-leak-template-cache
[#2218] Store cached templates weakly
2020-12-31 19:43:42 +01:00
Jan-Willem Gmelig Meyling
60e2f3a901 [#658] Support JPQL Treated paths for WHERE clause
JPA 2.1 introduced the TREAT operator for explicit casting. Initial support for TREAT in the FROM clause was added in PR #705. However, the specification also describes the notion of `treated_subpath` expressions (chapter 4.4.4.1) that are allowed in the WHERE clause of a query.

The syntax is as follows:

> ```
> treated_subpath ::= TREAT(general_subpath AS subtype)
>
> single_valued_path_expression ::= qualified_identification_variable | TREAT(qualified_identification_variable AS subtype) | state_field_path_expression | single_valued_object_path_expression
> ```

And can be used as such:

```SQL
SELECT e FROM Employee e JOIN e.projects p WHERE TREAT(p AS LargeProject).budget > 1000
```

(Example from chapter 4.4.9).

This pull request adds the support for treated subpaths in QueryDSL. It does so by introducing a new `PathType` and convenience method `JPAExpressions.treat`.
2020-12-31 17:59:34 +01:00
Jan-Willem Gmelig Meyling
261612a37b Fix inconsistency between final and non-final methods in ComparableExpression, ComparableExpressionBase and SimpleExpression 2020-12-31 17:57:32 +01:00
Jan-Willem Gmelig Meyling
6d612d9435 [#2504] [#2053] Fix fetchResults for GROUP BY and HAVING in JPQL" 2020-12-31 17:56:06 +01:00
Jan-Willem Gmelig Meyling
0fb26e84c8 [#2479] Migrate off of JSR305 2020-12-31 17:52:35 +01:00
Jan-Willem Gmelig Meyling
f62c06cac4 [#2218] Store cached templates weakly
Fixes #2218
2020-12-31 17:18:44 +01:00
Jan-Willem Gmelig Meyling
1c7f72e901 Merge branch 'issue/2671' into java-8-2 2020-12-28 16:06:53 +01:00
Jan-Willem Gmelig Meyling
f20697e9a1 [#2671] Make Alias.* thread-safe 2020-12-28 15:16:43 +01:00
Jan-Willem Gmelig Meyling
ac878c7f10 Removed Guava use in CollectionUtils 2020-12-25 18:01:37 +01:00
Jan-Willem Gmelig Meyling
138f61363d Removed Guava's Primitive usage 2020-12-25 17:52:22 +01:00
Jan-Willem Gmelig Meyling
7f9849e86d Removed Guava Collection occurrences 2020-12-23 23:38:21 +01:00
Jan-Willem Gmelig Meyling
5ffbc0a0cc Implemented unmodifiable collection utils 2020-11-15 20:46:21 +01:00
Jan-Willem Gmelig Meyling
f1be28ab37 Replace Guava Stopwatch for benchmarks 2020-11-15 20:46:21 +01:00
Jan-Willem Gmelig Meyling
73e8305049 Eliminate more Guava API's 2020-11-15 20:46:10 +01:00
Jan-Willem Gmelig Meyling
33ea95a912 Replace Guava Iterables 2020-11-01 00:01:30 +01:00
Jan-Willem Gmelig Meyling
a6b5d0ad6b Replace Guava Function 2020-10-31 23:36:32 +01:00
Jan-Willem Gmelig Meyling
36f1299abc Replace Guava API's with Java 8 ones 2020-10-31 23:35:47 +01:00
Jan-Willem Gmelig Meyling
5abd478fc3 Add Fetchable#stream method 2020-10-27 16:07:26 +01:00
Jan-Willem Gmelig Meyling
9f859baccc Java 6/7/8 performance upgrades and migrations 2020-10-26 22:59:40 +01:00
Jan-Willem Gmelig Meyling
dfc50ac0d9 Target Java 8 for compilation 2020-10-26 19:49:27 +01:00
Petr Kotek
ffd1e729cb Expressions: fix equals method - e.g. Expressions.asString("foo").equals(Expressions.asString("foo")) should return true
also add test coverage
2020-07-28 21:50:20 +02:00
John Tims
c038ffcded Merge branch 'null-expression' of git://github.com/Danepic/querydsl into Danepic-null-expression 2020-05-28 08:06:30 -06:00
John Tims
c0cf15d1b1
Merge pull request #2373 from yorlov/master
Replace 'while' and 'for' loop to 'foreach'
2020-05-27 06:52:08 -06:00
Ido Salomon
c1dc00ca66 Revert "issue-2303: Consider optimising AbstractSQL::newInstance (becomes a bottleneck for small queries)"
This reverts commit 1b2af5510d.
2020-03-02 23:28:19 +02:00
Rajesh Balamohan
1b2af5510d issue-2303: Consider optimising AbstractSQL::newInstance (becomes a bottleneck for small queries) 2020-03-02 18:42:27 +02:00
Pavel Polívka
383236b3c9
Hibernate 5 3 fix proper solution (#2354)
* Fix: Hibernate compatibility issues (up to at least 5.4)
2020-02-29 17:31:53 +02:00
Danilo
c90bd88b54 Support Character.class in EnumConversion 2020-02-08 17:24:38 +02:00
Unknown
455a0e2e00 NullExpression with type 2019-02-08 03:36:21 -02:00
Yuri Orlov
97bfe08d68
Replace 'while' and 'for' loop to 'foreach' 2018-10-27 17:43:33 +03:00
Timo Westkämper
8e9bfeaea5 Fixes for release 2018-03-18 19:17:17 +02:00
Ruben Dijkstra
62d0ad4d76
Merge pull request #2241 from reegnz/fix-throws-javadoc
Explicitly declare NonUniqueResultException for fetchOne
2018-03-14 13:50:41 +01:00
Ruben Dijkstra
dde4771aab Fix inverted equals expression in ne() 2018-03-09 14:27:39 +01:00
Zoltán Reegn
3a74aaeabc Explicitly declare NonUniqueResultException for fetchOne
Fetchable.fetchOne() declares in it's javadoc that it throws
NonUniqueResultException. It should therefore be explicitly declared in
the method signature as well.
All implementations must also declare in their signature that they throw.

This also has the desirable side-effect of the javadoc of all of the
implementors inheriting the @throws section from the javadoc of the
interface as well.

Fixes #2232
2018-01-16 14:03:05 +01:00
Timo Westkämper
a5e39ffa98 Merge pull request #1970 from querydsl/i1958
Initialize ConstructorExpression eagerly
2016-07-22 23:59:45 +03:00
Timo Westkämper
ab6f3f366e Fix serialization 2016-07-22 21:16:08 +03:00
Ruben Dijkstra
2688cd7a9b Add serializability test for ConstructorExpression 2016-07-19 15:54:16 +02:00
Ruben Dijkstra
1833e64855 Add thread safety test for ConstructorExpression 2016-07-19 15:54:09 +02:00
Ruben Dijkstra
0d2a6e4eba Extract class for Thread Safety checks 2016-07-19 15:54:08 +02:00
Marvin Froeder
a2760a2c43 Fixed map grouping by, was generating an invalid jpql query 2016-07-18 13:23:51 +12:00
Timo Westkämper
64a05e7b1f Initialize ConstructorExpression eagerly 2016-07-16 09:56:35 +03:00
Timo Westkämper
fc8b5da0fb Merge pull request #1935 from querydsl/i1933
Use default locale instead of ENGLISH
2016-06-30 21:59:27 +03:00