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

Custom object isn't readable when using @ViewEntries #472

Closed
jesse-gallagher opened this issue Sep 28, 2023 · 1 comment
Closed

Custom object isn't readable when using @ViewEntries #472

jesse-gallagher opened this issue Sep 28, 2023 · 1 comment
Labels
bug Something isn't working nosql
Milestone

Comments

@jesse-gallagher
Copy link
Member

It seems that using a custom object property with @ItemStorage(type = ItemStorage.Type.JSON) fails when reading view entries, but not with a normal method or @ViewDocuments.

Custom class:

public class JsonConfig {
  public String id, unid, title;
  public String[] arr;
}

Repo:

public interface Repository extends DominoRepository<Employee, String> {
  @ViewEntries("Employee")
  Stream<Employee> findAllPerView();
}

Property:

private @Column @ItemStorage(type = ItemStorage.Type.JSON) JsonConfig jsonConfig;

Stack trace:

java.lang.UnsupportedOperationException: The type class model.JsonConfig is not supported yet
  at jakarta.nosql.ValueReaderDecorator.read(ValueReaderDecorator.java)
  at org.eclipse.jnosql.communication.DefaultValue.get(DefaultValue.java:51)
  at org.eclipse.jnosql.mapping.reflection.AbstractFieldMapping.getValue(AbstractFieldMapping.java:107)
  at org.eclipse.jnosql.mapping.reflection.DefaultFieldMapping.getValue(DefaultFieldMapping.java:26)
  at org.eclipse.jnosql.mapping.document.DocumentFieldConverters$DefaultConverter.convert(DocumentFieldConverters.java:133)
  at org.eclipse.jnosql.mapping.document.AbstractDocumentEntityConverter.lambda$feedObject$6(AbstractDocumentEntityConverter.java:124)
  at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
  at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
  at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1580)
  at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:497)
  at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:487)
  at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
  at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
  at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:241)
  at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
  at org.eclipse.jnosql.mapping.document.AbstractDocumentEntityConverter.convertEntity(AbstractDocumentEntityConverter.java:110)
  at org.eclipse.jnosql.mapping.document.AbstractDocumentEntityConverter.toEntity(AbstractDocumentEntityConverter.java:96)
  at org.eclipse.jnosql.mapping.document.DefaultDocumentEntityConverter$Proxy$_$$_WeldClientProxy.toEntity(Unknown Source)
  at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
  at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
  at java.util.Iterator.forEachRemaining(Iterator.java:116)
  at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
  at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:497)
  at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:487)
  at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
  at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:241)
  at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
  at rest.EmployeeResource.getPerView(EmployeeResource.java:77)
  ...
@jesse-gallagher
Copy link
Member Author

In doing this, I also expanded the JSON enum's Javadoc to mention that it will cause the item to be non-summary by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nosql
Projects
None yet
Development

No branches or pull requests

1 participant