title: How to initialize an entity which is represented by a Vaadin Grid's row?
body: <p>I use <code>Vaadin</code> framework v23 for my project.</p>
  <p>A wanted to add a component column to one of my Grids, a number field. My Grid's rows are representing an entity from the database my program connected to.
  I ask for an input from the user, and I want to write that input back to the DB.
  I found this solution at several sites:</p>
  <pre><code>private Grid&lt;Honey&gt; initHoneyGrid() {
      Grid&lt;Honey&gt; honeyGrid = new Grid&lt;&gt;(Honey.class);
  
      honeyGrid.setItems(honeys);
      honeyGrid.removeColumnByKey(&quot;id&quot;);
      honeyGrid.removeColumnByKey(&quot;quantityPacked&quot;);
      honeyGrid.removeColumnByKey(&quot;flatCost&quot;);
      honeyGrid.removeColumnByKey(&quot;sellingPrice&quot;);
      honeyGrid.setColumns(&quot;kindOfHoney&quot;, &quot;weight&quot;, &quot;quantityBack&quot;);
  
      honeyGrid.addComponentColumn(item -&gt; new NumberField(&quot;Set the quantity you brought back'&quot;, event -&gt; {
          item.setQuantityBack(event.getValue().intValue());
          honeyService.updateHoney(item);
          honeyGrid.getDataProvider().refreshAll();
      }));
  
      return honeyGrid;
  }
  </code></pre>
  <p>However, the variable &quot;item&quot; throws NullPointerException. The &quot;honeys&quot; variable is an ArrayList, which is filled from the DB directly. I use Spring Boot JPA to access the database. How can I avoid it?</p>