spring-data-aerospike
spring-data-aerospike copied to clipboard
Using projection with repository.findById()
Hello,
I am unable to use projections together with repository.findById()
Please see here for my setup: https://github.com/william-harris/aerospike-projection
The two tests that use findById() are failing.
Hello @william-harris!
Thanks for inquiry.
First of all, using repository "findById" queries with projection will be included in the next release 4.4.0 (coming soon).
Secondly, in your Person object there is no need to annotate id field as @Field and @Indexed (after all, you have not added the id field to the projection class PersonName anyway). The @Id annotation means that it is actually not a regular field but a special id property, so @Id var id: Long?, is correct.
Thank you for the clarification. I added those annotations because I got errors when they were omitted. Might I suggest throwing an UnsupportedOperationException in the future when callers attempt to do something which isn't supported?
Thanks @william-harris, we will consider your feedback.
Did you get a chance to use findById with projections?
By the way, you can check the newest release of Spring Data Aerospike.
Closed due to inactivity.