title: Convert stream BigDecimal summing to JavaFX Property
body: <p>I have a problem trying to convert a bigdecimal to ObjectProperty</p>
  
  <pre><code>public class LinePiece {
  
      private int idLine;
      private ObjectProperty&lt;BigDecimal&gt; qty = new SimpleObjectProperty&lt;BigDecimal&gt;(BigDecimal.ZERO);
      private ObjectProperty&lt;BigDecimal&gt; price = new SimpleObjectProperty&lt;BigDecimal&gt;(BigDecimal.ZERO);
      private ObjectProperty&lt;BigDecimal&gt; remise = new SimpleObjectProperty&lt;BigDecimal&gt;(BigDecimal.ZERO);
      private IntegerProperty tva = new SimpleIntegerProperty();
      private ObjectProperty&lt;BigDecimal&gt; subTotal = new SimpleObjectProperty&lt;BigDecimal&gt;(BigDecimal.ZERO);
  // Getters and Setters
  }
  </code></pre>
  
  <p>We have a set of items of type LinePiece</p>
  
  <pre><code>private Set&lt;LinePiece&gt; LinePieces = new HashSet&lt;&gt;();
    LinePieces .add(new LinePiece());
    LinePieces .add(new LinePiece());
    LinePieces .add(new LinePiece());
  </code></pre>
  
  <p>After implementing summing to the actual set:</p>
  
  <pre><code>BigDecimal sum = lineCommande.stream().map(LineCommande::getSubTotal)
                  .reduce(BigDecimal.ZERO,BigDecimal::add);
  </code></pre>
  
  <p>I want to make sum observable, so i can listen for sum changes.
  How i can acheive this ?</p>
  
  <p>Remark: I can't use ObservableList here because i'm using hibernate</p>
  
  <pre><code> @OneToMany(mappedBy = "piece", fetch = FetchType.EAGER, orphanRemoval = true, cascade = CascadeType.ALL)
      private Set&lt;LinePiece&gt; LinePieces = new HashSet&lt;&gt;();
  </code></pre>
  
  <p>if there another solution using ObservableList please tell me.</p>