Type mismatch: cannot convert from List<Tuple> to List<Object[]>

729 views
Skip to first unread message

Ghalleb

unread,
May 7, 2013, 5:04:08 PM5/7/13
to quer...@googlegroups.com
Hi,

I'm trying to upgrade from 2.9.0 to 3.1.1

This code:

        final List<Object[]> resultS = queryS.list(selectedNumberPaths.values().toArray(new SimpleExpression[selectedNumberPaths.size()]));

Give me the error

        Type mismatch: cannot convert from List<Tuple> to List<Object[]>


What's the best way to make it work like it used to?



Timo Westkämper

unread,
May 7, 2013, 5:14:06 PM5/7/13
to Querydsl on behalf of Ghalleb
Hi.

Tuple projection was made the default since it it more useful than the Object array projection.

You can use the following code to get an Object array out

List<Object[]> resultS = queryS.list(
    Projections.array(Object[].class,
        selectedNumberPaths.values().toArray(
new SimpleExpression[selectedNumberPaths.size()])));

Br,
Timo



--
You received this message because you are subscribed to the Google Groups "Querydsl" group.
To unsubscribe from this group and stop receiving emails from it, send an email to querydsl+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Timo Westkämper
Mysema Oy
+358 (0)40 591 2172
www.mysema.com


Reply all
Reply to author
Forward
0 new messages