title: how to add same object in objectbox's box multiple times?
body: <p>I have ToMany relation which looks like this,</p>
  <pre><code>@Entity()
  class Pdf {
    @Id()
    int id;
    Uint8List pdfData;
    final String customerName;
    @Property(type: PropertyType.date)
    final DateTime dateTime;
    @Backlink()
    var products = ToMany&lt;Product&gt;();
    double totalAmount;
    PaymentStatus paymentStatus;
  
    Pdf({
      this.id = 0,
      required this.pdfData,
      required this.dateTime,
      required this.customerName,
      required this.totalAmount,
      this.paymentStatus = PaymentStatus.unPaid,
    });
  
    int get status =&gt; paymentStatus.index;
  
    set status(int value) {
      paymentStatus = PaymentStatus.values[value];
    }
  }
  </code></pre>
  <pre><code>@Entity()
  class Product {
    @Id()
    int id;
    String name;
    String category;
    int categoryId;
    WeightType weightType;
    double? price;
    double weight;
    bool isRefunded;
    final pdf = ToOne&lt;Pdf&gt;();
  
    Product({
      this.id = 0,
      required this.name,
      required this.category,
      required this.categoryId,
      this.weightType = WeightType.kg,
      this.price,
      this.weight = 0,
      this.isRefunded = false,
    });
    Product copy() =&gt; Product(
          name: name,
          category: category,
          id: id,
          price: price,
          weight: weight,
          weightType: weightType,
          categoryId: categoryId,
          isRefunded: isRefunded,
        );
    }
  @override
    int get hashCode =&gt; hashValues(
          name.hashCode,
          price.hashCode,
          id.hashCode,
          category.hashCode,
          categoryId.hashCode,
          weightType.hashCode,
          weight.hashCode,
          isRefunded.hashCode,
        );
  
    @override
    bool operator ==(Object other) =&gt;
        other is Product &amp;&amp;
        other.name == name &amp;&amp;
        price == other.price &amp;&amp;
        category == other.category &amp;&amp;
        categoryId == other.categoryId &amp;&amp;
        other.weight == weight &amp;&amp;
        other.weightType == weightType &amp;&amp;
        other.id == id;
  }
  </code></pre>
  <p>this is how I'm putting it in the box,</p>
  <pre><code>void add(){
  final billPdf = Pdf(
        pdfData: pdf,
        dateTime: DateTime.now(),
        customerName: bill.customerName,
        totalAmount: bill.totalAmount,
        paymentStatus: bill.paymentStatus,
      );
      billPdf.products.addAll(bill.products);
      DBService.pdfBox.put(billPdf,mode: obj.PutMode.put);
  }
  </code></pre>
  <p>now when I try add same product in the <code>box</code>, it removes the previous data from the list(db) and only adds the latest one so it is just updating the product. And if I change the <code>PutMode</code> to <code>insert</code>, it gives me exception. like this,</p>
  <pre><code>object put failed
  </code></pre>
  <p>I found this for kotlin,
  <a href="https://stackoverflow.com/questions/51837559/cant-save-same-data-using-objectbox-with-android-kotlin">Can&#39;t save same data using ObjectBox with Android (Kotlin)</a></p>
  <p>From this I even overrided the <code>hashcode</code> and put some different value but it still removes previous values and also in my use case everything can be same.</p>
  <p>So How can I put same objects in object-box?</p>