Notable changes to the ObjectBox Java library.
For more insights into what changed in the ObjectBox C++ core, check the ObjectBox C changelog.
- Make closing the Store more robust. In addition to transactions, it also waits for ongoing queries. This is just an additional safety net. Your apps should still make sure to finish all Store operations, like queries, before closing it.
- Flex properties support
null
map and list values. - Some minor vector search performance improvements.
- Fix a serious regression, please update as soon as possible.
- Add new options, notably for cluster configuration, when building
SyncServer
. Improve documentation. Deprecate the old peer options in favor of the new cluster options. - Add
SyncHybrid
, a combination of a Sync client and a Sync server. It can be used in local cluster setups, in which a "hybrid" functions as a client & cluster peer (server).
- Add convenience
oneOf
andnotOneOf
conditions that acceptDate
to avoid manual conversion usinggetTime()
. - When
BoxStore
is closing, briefly wait on active transactions to finish. - Guard against crashes when
BoxStore
was closed, but database operations do still occur concurrently (transactions are still active).
- Examples: added Vector Search example that demonstrates how to perform on-device approximate nearest neighbor (ANN) search.
- Revert deprecation of
Box.query()
, it is still useful for queries without any condition. - Add note on old query API methods of
QueryBuilder
that they are not recommended for new projects. Use the new query APIs instead. - Update and expand documentation on
ToOne
andToMany
.
ObjectBox now supports Vector Search to enable efficient similarity searches.
This is particularly useful for AI/ML/RAG applications, e.g. image, audio, or text similarity. Other use cases include semantic search or recommendation engines.
Create a Vector (HNSW) index for a floating point vector property. For example, a City
with a location vector:
@Entity
public class City {
@HnswIndex(dimensions = 2)
float[] location;
}
Perform a nearest neighbor search using the new nearestNeighbors(queryVector, maxResultCount)
query condition and the new "find with scores" query methods (the score is the distance to the query vector). For example, find the 2 closest cities:
final float[] madrid = {40.416775F, -3.703790F};
final Query<City> query = box
.query(City_.location.nearestNeighbors(madrid, 2))
.build();
final City closest = query.findWithScores().get(0).get();
For an introduction to Vector Search, more details and other supported languages see the Vector Search documentation.
- BoxStore: deprecated
BoxStore.sizeOnDisk()
. Instead use one of the new APIs to determine the size of a database:BoxStore.getDbSize()
which for a file-based database returns the file size and for an in-memory database returns the approximately used memory,BoxStore.getDbSizeOnDisk()
which only returns a non-zero size for a file-based database.
- Query: add properly named
setParameter(prop, value)
methods that only accept a single parameter value, deprecated the oldsetParameters(prop, value)
variants. - Sync: add
SyncCredentials.userAndPassword(user, password)
. - Gradle plugin: the license of the Gradle plugin has changed to the GNU Affero General Public License (AGPL).
See the Changelogs in the documentation.