Eccenux opened a new issue, #9542:
URL: https://github.com/apache/netbeans/issues/9542
### Apache NetBeans version
Apache NetBeans 30
### What happened
I keep getting a warning "No constructors can de found that match the
argument types" for HQL with DTO class.
### Language / Project Type / NetBeans Component
Java Maven Web application project
### How to reproduce
Package structure (simplified):
- webapp (REST controllers)
- api (interface, dto)
- core (DAO, service)
- api (interface, dto)
- ent (entities)
in example-api:
```java
package com.example.domain;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ResourceCategoryMini {
private Long id;
private Boolean active;
private String label;
private String description;
}
```
in example-core:
```java
package com.example.core.dao;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.example.domain.ResourceCategoryMini;
@Repository
public class ResourceCategoryDAO {
@Autowired
protected SessionFactory sessionFactory;
/**
* Returns a minimal resource category list.
*
* @return resource category list
*/
public List<ResourceCategoryMini> listMini() {
Session session = sessionFactory.getCurrentSession();
var results = session.createQuery("""
select new com.example.domain.ResourceCategoryMini(
r.id,
r.active,
r.label,
r.description
)
from ResourceCategoryEntity r
order by id asc
""", ResourceCategoryMini.class)
.getResultList();
return results;
}
}
```
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Windows 11 version 10.0 running on amd64; UTF-8; pl_PL (nb)
### JDK
Runtime: OpenJDK Runtime Environment 21.0.8+9-LTS
### Apache NetBeans packaging
Community provided installer
### Anything else
<img width="410" height="137" alt="Image"
src="https://github.com/user-attachments/assets/91a30a92-2ce2-4a12-859f-eb7c85fb0f02"
/>
### Are you willing to submit a pull request?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists