java.lang.NullPointerException: Cannot provide an id for a null item.
at java.util.Objects.requireNonNull(Objects.java:228)
at com.vaadin.flow.data.provider.DataProvider.getId(DataProvider.java:132)
at com.vaadin.flow.data.provider.KeyMapper.has(KeyMapper.java:105)
at com.vaadin.flow.data.provider.DataCommunicator.lambda$activate$5(DataCommunicator.java:639)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$11$1.accept(ReferencePipeline.java:373)
at java.util.stream.SliceOps$1$1.accept(SliceOps.java:204)
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
Hi Alejandro,
refreshGrid() will throw NullPointerException if the spring boot JPA nativeQuery result is null.
gridCrud.setFindAllOperation(() -> service.findAllByCreatedBetween( fromDatePicker.getValue(), toDatePicker.getValue())); gridCrud.refreshGrid();
java.lang.NullPointerException: Cannot provide an id for a null item. at java.util.Objects.requireNonNull(Objects.java:228) at com.vaadin.flow.data.provider.DataProvider.getId(DataProvider.java:132) at com.vaadin.flow.data.provider.KeyMapper.has(KeyMapper.java:105) at com.vaadin.flow.data.provider.DataCommunicator.lambda$activate$5(DataCommunicator.java:639) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.util.stream.ReferencePipeline$11$1.accept(ReferencePipeline.java:373) at java.util.stream.SliceOps$1$1.accept(SliceOps.java:204) at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359) at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)