When i try this query with nested constructor with my custum DTO.
select new DTO.foo ( new DTO.boo( ... ) , new DTO.boo( ... ) ) from Foo
I got this error :
org.hibernate.hql.internal.ast.QuerySyntaxException:
unexpected token: new near line 1, column 23 [ select new DTO.foo ( new DTO.boo( ... ) , .....
SOLUTION
Since we cannot have a constructor within a constructor because it's illegal in JPQL We resolve this issue by following the same approach over here : https://stackoverflow.com/a/12742926/1383538
QuerySyntaxExceptionso there is no generated hibernate query yet