quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.8k stars 2.68k forks source link

Add Support of Spring Data JPA specific JpaSpecificationExecutor #4040

Open hantsy opened 5 years ago

hantsy commented 5 years ago

Quarkus 0.22.0

I just tried Spring Data JPA feature, the first limitation is JpaSpecificationExecutor does not work.

https://github.com/hantsy/quarkus-sample/tree/master/spring-post-service

public interface PostRepository extends JpaRepository<Post, String>//, JpaSpecificationExecutor<Post>
{

}
geoand commented 5 years ago

We have made it clear that not everything from Spring Data will work on Quarkus. Can you give some details about how you usually use JpaSpecificationExecutor?

hantsy commented 5 years ago

Some like the purpose I described in issue #4016 and #3965.

JpaSpecificationExecutor is to support JPA Criteria and also introduces a great Specification (a DDD concept) to satisfy Type-safe query requirements.

Many developers are practicing Typesafe query instead of string based query in development.eg. QueryDSL, JPA Criteria, JOOQ etc.

geoand commented 5 years ago

Thanks for the info.

When we have a general strategy around how Panache will handle such Typesafe handling, we can revisit this

hantsy commented 1 year ago

@geoand Micronaut Data ports this Specification concept(a type safe approach to compose the query criteria) to almost all data modules, including Data Jdbc, Data R2dbc, and Data Hibernate Reactive.

Michael-AT-Corporation commented 3 months ago

@geoand I suppose it is still nowhere near to be supported, right? Although it would be nice 🙂 Maybe it could be added to the unsupported features in the spring-data-jpa documentation?

geoand commented 3 months ago

@Michael-AT-Corporation correct. We are likely to figure out the type-safe query strategy soon (cc @FroMage). In the meantime, I opened #42216 to update the docs

Michael-AT-Corporation commented 3 months ago

@geoand Thanks for the info and for updating the documentation 🙂

geoand commented 3 months ago

🙏🏼

FroMage commented 3 months ago

We are adding type-safe queries, but using HQL, not specifications. However thanks for the point, I've noted the use-case.

pipinet commented 2 weeks ago

@geoand @FroMage @hantsy Is there support for a JpaSpecificExecutor program? Because currently he can easily support Hibernate Data Repositories. Micronaut Data also provides similar support.

This allows us to write more convenient、dynamic and typed JPQL。