Playing with QueryDSL library.
Found interesting function
public static <T> ArrayConstructorExpression<T> array(Class<T[]> type, Expression... exprs)
I've never seen such a Generic as mentioned above. How can I pass the first parameter there?
Googling last hour, but no result for now.
Assuming T is of class Integer, you can do as follows:
ArrayConstructorExpression<Integer> arr = array(Integer[].class, someExpression);
There's no magic here. Integer[].class is the class that represents arrays of Integer objects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With