Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using projection with repository.findById() #613

Open
william-harris opened this issue Aug 10, 2023 · 3 comments
Open

Using projection with repository.findById() #613

william-harris opened this issue Aug 10, 2023 · 3 comments

Comments

@william-harris
Copy link

william-harris commented Aug 10, 2023

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.

@agrgr
Copy link

agrgr commented Aug 10, 2023

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.

@william-harris
Copy link
Author

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?

@agrgr
Copy link

agrgr commented Dec 19, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants