Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Projection and Slice return type #2133

Closed
Flexy-recruitment-backend opened this issue Jan 24, 2020 · 2 comments · Fixed by #2146
Closed

Projection and Slice return type #2133

Flexy-recruitment-backend opened this issue Jan 24, 2020 · 2 comments · Fixed by #2146
Assignees
Labels
datastore GCP Datastore P1

Comments

@Flexy-recruitment-backend
Copy link

Hello,
I am trying to use projection in order to query an entity in the datastore. I don't manage to use Slice as return type with my projection. The same thing works fine with a Page return type :

My entity is called "Customer" and have a lot of fields.
I have created a projection interface called CustomerProjection :

public interface CustomerProjection { String getLastName(); }

And in my repository, I have the following request :

public interface CustomerRepository extends DatastoreRepository<Customer, Long> { Page<CustomerProjection> findByIsActiveAndIsDeleted(boolean isActive, boolean isDeleted, Pageable pageable); }

This request work well, but when I change the return type in "Slice", I constat at runTime that I obtain a Slice<Customer> in place of Slice<CustomerProjection>

Is that a bug? is this problem due to some mistake from me?
Regards
CG

@meltsufin meltsufin added the datastore GCP Datastore label Jan 24, 2020
@dmitry-s dmitry-s self-assigned this Jan 24, 2020
@dmitry-s
Copy link
Contributor

It looks like a bug, I'll take a look.

@Flexy-recruitment-backend
Copy link
Author

I confirm that the correction of the issue #2146 solve the problem!
Thank you.
Regards
CG

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
datastore GCP Datastore P1
Development

Successfully merging a pull request may close this issue.

4 participants