You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actual behavior
It just try to retrieve the full object and fails with Cast error:
Caused by: java.lang.ClassCastException: class org.acme.entities.Contact cannot be cast to class org.acme.data.SimpleContactProjection (org.acme.entities.Contact and org.acme.data.SimpleContactProjection are in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @363f6148)
All tests should be passed (build succeed):
./gradlew clean build
Also you can find commented out stuff in this repo. That was my try to use dynamic projections/DTO.
It breaks build at all.
Environment (please complete the following information):
Output of uname -a or ver: Darwin MacBook-Pro-Alexander.local 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64
Output of java -version: openjdk 11.0.5 2019-10-15 LTS
Quarkus version or git rev: 1.9.1.Final
Build tool (ie. output of mvnw --version or gradlew --version): Gradle 6.6.1
The text was updated successfully, but these errors were encountered:
Does not look like this issue was fixed.
Keep getting this error for my tests.
org.acme.resteasy.ContactResourceTest > testDto() FAILED
java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.spring.data.deployment.SpringDataJPAProcessor#build threw an exception: java.lang.IllegalArgumentException: findByUsername of Repository org.acme.repositories.SimpleContactDtoRepository can only use interfaces to map results to non-entity types.
at io.quarkus.spring.data.deployment.generate.DerivedMethodsAdder.add(DerivedMethodsAdder.java:187)
at io.quarkus.spring.data.deployment.generate.SpringDataRepositoryCreator.implementCrudRepository(SpringDataRepositoryCreator.java:116)
at io.quarkus.spring.data.deployment.SpringDataJPAProcessor.implementCrudRepositories(SpringDataJPAProcessor.java:273)
```
Describe the bug
Spring Data API supports DTO and Projections.
Here you can read how it should work:
https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#projections
Expected behavior
DTO and Projections should work
Actual behavior
It just try to retrieve the full object and fails with Cast error:
To Reproduce
Please check this repo:
https://github.com/engilyin/quarkus-spring-dto.git
All tests should be passed (build succeed):
./gradlew clean build
Also you can find commented out stuff in this repo. That was my try to use dynamic projections/DTO.
It breaks build at all.
Environment (please complete the following information):
Output of
uname -a
orver
: Darwin MacBook-Pro-Alexander.local 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64Output of
java -version
: openjdk 11.0.5 2019-10-15 LTSQuarkus version or git rev: 1.9.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
): Gradle 6.6.1The text was updated successfully, but these errors were encountered: