How can I query the following entity:
public class Test {
private String id
private String test
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "foo-bar",
joinColumns = {@JoinColumn(name = "map_id", referencedColumnName = "id")})
@MapKeyColumn(name = "property_name")
@Column(name = "property_value")
private Map<String, String> dataMap = new HashMap<>();
}
To following projection using querydsl, spring boot v3 and jpa:
public record TestProjection(
String id,
String test,
Map<String, String> dataMap // ??? I can not map dataMap into projection
) {
@QueryProjection
public TestProjection{}
}