Hi,
I am using querydsl to get a bunch of records from the database and project it into a dto using the GroupBy.map for one of my columns. I get an InvocationTargetException when the map has any value which is null. I have verified that none of the keys (id columns) are null.The same expression seems to be working fine when I use lists instead of map.
This seems to be occurring in the ConstructorExpression.class. Is this a bug with querydsl and if so will there be a fix for this in the near future.
Also is there support available in querydsl for multiple level hierarchical join queries and being able to project them onto DTOs.
Cheers,
Suchi
In my scenario a user can have multiple roles and each of these roles can have multiple security groups.
The SQL query is as follows:-
select u1.id,u1.name,r1.id,r1.name,s1.name from users u1
Join roles r1 on u1.role = r1.id
Join security_groups s1 on r1.secgroup = s1.id
I am trying to use the query dsl to project the above query into a dto structure as below
UserDto
Long id;
String name;
List<Long> roleIds;
List<String> roleNames;
List<Long> secIds;
As an example if the user had a role and the role had 2 security groups then I need to have the 1 role coming back in my dto structure. However when I tried to use the groupby.list by specifying the user.Id as the group by expression, the transform method seemed to be returning 2 items for roleIds. To overcome this I used the groupby.map which seems to throw an exception when there are null values in the columns , for instance role names.
Is there support within querydsl to support the kind of scenario I have described above, to flatten a 2 level hierarchy into the one dto?
Please feel free to let me know if you need any more details from my end?
Cheers,
Suchi
Hi Timo,In my scenario a user can have multiple roles and each of these roles can have multiple security groups.
The SQL query is as follows:-
select u1.id,u1.name,r1.id,r1.name,s1.name from users u1
Join roles r1 on u1.role = r1.id
Join security_groups s1 on r1.secgroup = s1.idI am trying to use the query dsl to project the above query into a dto structure as below
UserDto
Long id;
String name;
List<Long> roleIds;
List<String> roleNames;
List<Long> secIds;
As an example if the user had a role and the role had 2 security groups then I need to have the 1 role coming back in my dto structure. However when I tried to use the groupby.list by specifying the user.Id as the group by expression, the transform method seemed to be returning 2 items for roleIds. To overcome this I used the groupby.map which seems to throw an exception when there are null values in the columns , for instance role names.
Is there support within querydsl to support the kind of scenario I have described above, to flatten a 2 level hierarchy into the one dto?