mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
fixed EArrayConstructor signature
This commit is contained in:
parent
030d9207ca
commit
f350a582bc
@ -193,7 +193,7 @@ public abstract class AbstractColQuery<SubType extends AbstractColQuery<SubType>
|
||||
orderByExpr[i] = (Expr) orderBy.get(i).getTarget();
|
||||
directions[i] = orderBy.get(i).getOrder() == Order.ASC;
|
||||
}
|
||||
Expr<?> expr = new EArrayConstructor<Object>(Object.class, orderByExpr);
|
||||
Expr<?> expr = new EArrayConstructor<Object>(Object[].class, orderByExpr);
|
||||
Evaluator ev = evaluatorFactory.create(sources, expr);
|
||||
|
||||
// transform the iterator to list
|
||||
@ -230,7 +230,7 @@ public abstract class AbstractColQuery<SubType extends AbstractColQuery<SubType>
|
||||
@SuppressWarnings("unchecked")
|
||||
public Iterator<Object[]> iterate(Expr<?>[] args) {
|
||||
arrayProjection = true;
|
||||
Expr<Object[]> projection = new EArrayConstructor(Object.class, args);
|
||||
Expr<Object[]> projection = new EArrayConstructor(Object[].class, args);
|
||||
return iterate(projection);
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.mysema.query.types.expr;
|
||||
|
||||
import com.mysema.commons.lang.Assert;
|
||||
import com.mysema.query.types.Visitor;
|
||||
|
||||
/**
|
||||
@ -20,9 +21,9 @@ public class EArrayConstructor<D> extends EConstructor<D[]> {
|
||||
private final Class<D> elementType;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public EArrayConstructor(Class<D> type, Expr<D>... args) {
|
||||
super((Class)Object.class, new Class[0], args);
|
||||
this.elementType = type;
|
||||
public EArrayConstructor(Class<D[]> type, Expr<D>... args) {
|
||||
super(type, new Class[0], args);
|
||||
this.elementType = (Class<D>) Assert.notNull(type.getComponentType());
|
||||
}
|
||||
|
||||
public final Class<D> getElementType() {
|
||||
|
||||
@ -88,7 +88,7 @@ public class StringTest {
|
||||
assertEquals("new SomeType(alias)", someType.toString());
|
||||
|
||||
// EArrayConstructor
|
||||
EArrayConstructor<SomeType> someTypeArray = new EArrayConstructor<SomeType>(SomeType.class,$(alias));
|
||||
EArrayConstructor<SomeType> someTypeArray = new EArrayConstructor<SomeType>(SomeType[].class,$(alias));
|
||||
assertEquals("[alias]", someTypeArray.toString());
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user