-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The transform method throws a ClassCastException when working with jo…
…inFetch since 4.4.0 (#534) * ported fix for #3264 querydsl/querydsl#3264 from https://github.com/aasyspl/querydsl * test for regression querydsl/querydsl#3264 * Allow test to throw exceptions when needed * Move logic for tuple creation to TupleUtils --------- Co-authored-by: sapolinarski <[email protected]> Co-authored-by: Marvin Froeder <[email protected]>
- Loading branch information
1 parent
01aadb8
commit 461bc56
Showing
6 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
querydsl-core/src/main/java/com/querydsl/core/util/TupleUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.querydsl.core.util; | ||
|
||
import com.querydsl.core.Tuple; | ||
import com.querydsl.core.types.Expression; | ||
import com.querydsl.core.types.Projections; | ||
|
||
/** TupleUtils provides tuple related utility functionality */ | ||
public final class TupleUtils { | ||
|
||
public static Tuple toTuple(Object next, Expression<?>[] expressions) { | ||
// workaround from https://github.com/querydsl/querydsl/issues/3264 | ||
Tuple tuple; | ||
if (next instanceof Tuple) { | ||
tuple = (Tuple) next; | ||
} else if (next instanceof Object[]) { | ||
tuple = Projections.tuple(expressions).newInstance((Object[]) next); | ||
} else { | ||
throw new IllegalArgumentException(String.format("Could not translate %s into tuple", next)); | ||
} | ||
return tuple; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters