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

JPA embedded objects: Sparse fieldsets ignored #664

Open
jmescheder opened this issue Jan 6, 2020 · 1 comment
Open

JPA embedded objects: Sparse fieldsets ignored #664

jmescheder opened this issue Jan 6, 2020 · 1 comment

Comments

@jmescheder
Copy link

Hi, I am trying to use sparse fieldsets on an entity with an embedded object, but the requested attribute is not being included in the response.

Example:
class A {

String a;
String b;

@Embedded
C c;
}

class C {
String d;
}

Filtering with the dot-notation works fine ( &filter[c.d]=foo ), but not the specification of a sparse fieldset: &fields=c.d

@remmeier
Copy link
Contributor

remmeier commented Jan 9, 2020

this is related to #399. On the good news side, just two weeks ago the necessary data model has been implemented (ResourceField.getEmbeddedType). Next step would be to implement this functionality here in ResourceMapper > setAttribute > isIncluded. PR welcome if somebody has time. Otherwise I may find time, but probably not the coming few weeks.

A second step would be to also honor the field set in JpaEntityRepositoryBase.findAll to just query the requested fields from the database rather than query all of them and truncate the result to the client.

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

No branches or pull requests

2 participants