2011-07-07 07:43:34 |
Marc Walter |
description |
When Querydsl generates a constructor using the annotation @QueryProjection Java primitives are converted into corresponding wrapper types. When the constructor is called a NoSuchMethodException occures because the generated constructor call does not match with the constructor annotated wiht @QueryProjection.
Example:
@QueryProjection
public SomeDto(final Long param1, final int param2, final int param3, final Long param4, final String param5)
Generated constructor call:
public QSomeDto(NumberExpression<Long> param1, NumberExpression<Integer> param2, NumberExpression<Integer> param3, NumberExpression<Long> param4, StringExpression param5) {
super(SomeDto.class, new Class[] {Long.class, Integer.class, Integer.class, Long.class, String.class}, value1, value2, value3, value4, value5);
} |
When Querydsl generates a constructor using the annotation @QueryProjection Java primitives are converted into corresponding wrapper types. When the constructor is called a NoSuchMethodException occures because the generated constructor call does not match with the constructor annotated with @QueryProjection.
Example:
@QueryProjection
public SomeDto(final Long param1, final int param2, final int param3, final Long param4, final String param5)
Generated constructor call:
public QSomeDto(NumberExpression<Long> param1, NumberExpression<Integer> param2, NumberExpression<Integer> param3, NumberExpression<Long> param4, StringExpression param5) {
super(SomeDto.class, new Class[] {Long.class, Integer.class, Integer.class, Long.class, String.class}, value1, value2, value3, value4, value5);
} |
|