speedment / jpa-streamer

JPAstreamer is a lightweight library for expressing JPA queries as Java Streams
GNU Lesser General Public License v2.1
339 stars 35 forks source link

How to get EntityName$ #306

Closed hendisantika closed 1 year ago

hendisantika commented 1 year ago

I try on my local is always error

 @GetMapping
    public ResponseEntity<?> findAllBooks() {
        return ResponseEntity.ok(
                jpaStreamer.stream(Book.class)
                        .sorted(Book$.id.reversed())
                        .collect(Collectors.toList()));
    }

Where we can get Book$.

(Film$ is automatically generated from the Film-table Entity at compile-time by JPAstreamer).

But when I try to run the app is error

Here is my repository link: https://github.com/hendisantika/spring-boot-data-jpastreamer

Thanks

julgus commented 1 year ago

I see you are using the annotation jakarta.persistence.Entity in your Author and Book classes. The annotation processor does not currently support JPA3 and thus only processes entities annotated with javax.persistence.Entity. We are in the process of issuing a JPA3 compatible version (#299), but we are holding it to include projection optimisations in the same release.

If you wish to use JPA3 today you can check out the sources on the branch jpa3 and build it locally until the release is out. Another option would be to use JPA2 for now.

Hope that helps.

julgus commented 1 year ago

Closing as this is covered by #299.

hendisantika commented 1 year ago

OK. Thanks