objectbox / objectbox/objectbox-java

Object update predicate

Open
#703 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
4.6k
Forks
311
PR merge metrics
No merged PRs in 30d

Description

Is it possible to add merge predicate when putting object that already exists? The thing is that we use ObjectBox on a very large application and server gives us the same object with different properties on different screens so we need to somehow merge the server response and the db object.
At the moment, we simply take the object from db, merge it with server object then put it back (same with collections), but I think that is slow and not effective compared to what native interface can possibly provide.
I can imagine it being:

box.put(object, (dbObject, ourObject) -> {
     //do the merge
});

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing Box.put API and the native interface mentioned in the issue. Compare current object and collection update behavior, then determine the expected predicate callback contract and how completion would be verified for merging an existing database object with the supplied object.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.