I am trying to get all my data with a single custom build call. I am using Spring Boot version 2.3.8.
My problem is that i want to get a list of Strings with a subquery on the select statement in the repository.

Here is example of "TestMapper" with data which i would like to map.

```
private String location;
private Date checkoutRequestAt;
private Date checkoutAt;
private List<String> macAddressList;
private Boolean checkout;

```

The custom build query:

```
    @Query(value = "select " +
        "new test.jpa.TestMapper(" +
        "l.name," +
        "l.checkoutRequestAt," +
        "l.checkoutAt," +
        "(select d.macAddress from Device d where d.location = l)," +
        "l.checkout" +
        ") " +
        "from Location l " +
        "where l.name = :locationName")
TestMapper getCheckoutInformationUsingLocationName(@Param("locationName") String locationName);

```

Please note that the sub query should return more then 1 result. The List object is right!

When i bootup the Application i get following exception..
I am more then sure i do the select statement in wrong way. Maybe some one have example for this?

```
Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Unable to locate appropriate constructor on class [test.jpa.TestMapper]. Expected arguments are: java.lang.String, java.util.Date, java.util.Date, java.lang.String, boolean [select new test.jpa.TestMapper(l.name,l.checkoutRequestAt,l.checkoutAt,(select d.macAddress from test.jpa.Device d where d.location = l),l.checkout) from test.jpa.Location l where l.name = :locationName]
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:138)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:725)
at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:366)
at com.sun.proxy.$Proxy171.createQuery(Unknown Source)
at org.springframework.data.jpa.repository.query.SimpleJpaQuery.validateQuery(SimpleJpaQuery.java:87)

```

By the way, if I change the List type to Object, I can start the spring boot project, but i will get exception that my select device query returns more then 1 result. The multiple results are expected as I can have multiple Devices assigned to a single location.