I use Redis OM Spring Entity Streams, which provides a Java 8 Streams interface to Query Redis JSON documents using RediSearch.
I want to generate a metamodel like Person$ to run the code below. But I couldn't figure out how to generate the metamodel for the Person document entity. Can you please help me to find out a way to generate the metamodel? Thanks in advance.
> // Find people by age range public Iterable<Person>
> findByAgeBetween(int minAge, int maxAge) {
> return entityStream //
> .of(Person.class) //
> .filter(Person$.AGE.between(minAge, maxAge)) //
> .sorted(Person$.AGE, SortOrder.ASC) //
> .collect(Collectors.toList()); }
For Gradle, you can add the OM dependency as an annotation processor using the
annotationProcessorcall in the dependencies block like:For Maven, things normally just work, when you run
./mvnw spring-boot:run. Some users have experienced this not being the case, in which I recommend to explicitly declaring themaven-compiler-pluginin the case below it's pair with an app create with start.spring.io v3.0.4 (all other versions can be inherited from the parent poms):Also, in case you are using IntelliJ Idea, see https://www.jetbrains.com/help/idea/annotation-processors-support.html#annotation_processing