By following the official tutorial for projections in spring data mongodb https://docs.spring.io/spring-data/mongodb/docs/current/reference/html/#projections will get an
java.lang.IllegalArgumentException: Couldn't find PersistentEntity for type class com.sun.proxy.$Proxy109!
for the NamesOnly Projection:
interface NamesOnly {
String getFirstname();
String getLastname();
}
@RepositoryRestResource
interface PersonRepository extends Repository<Person, UUID> {
Collection<NamesOnly> findByLastname(@Param("lastName") String lastname);
}
Can one get this example to work?