Although this is technically the changelog for Java, this is also a good reference of what changed in the ObjectBox C++ core.
- 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).
-
Support creating file-less in-memory databases, e.g. for caching and testing. To create one use
inMemory()
when building aBoxStore
:store = MyObjectBox.builder() .androidContext(context) .inMemory("test-db") .build();
See the
BoxStoreBuilder.inMemory()
documentation for details. -
Change
BoxStore.deleteAllFiles()
to support deleting an in-memory database. -
The
maxDataSizeInKByte()
option when building a store is ready for production use. This is different from the existingmaxSizeInKByte()
option in that it is possible to remove data after reaching the limit and continue to use the database. See its documentation for more details. -
Admin will now print a warning when it does not have permission to show the Admin notification. When testing your app on a device with Android 13 or newer, developers should manually turn on notifications to make use of the Admin notification.
-
Added examples on how to use Kotlin's unsigned integer types to Custom types.
-
Restore compatibility with Kotlin 1.5. However, need to exclude
kotlin-stdlib
1.8 fromobjectbox-kotlin
as it includes classes previously in the -jdk7/-jdk8 libraries to avoid duplicate class file errors. So if not absolutely needed, we still recommend to use at least Kotlin 1.8.
- Throw an exception instead of crashing when trying to create a query on a closed store. #1154
- The Gradle plugin now requires at least Gradle 7.0 and Android Gradle Plugin 4.1.
- The Android library now requires Android 4.4 (API 19) or newer.
- A new key/value validation option
validateOnOpenKv()
is available onMyObjectBox.builder()
to help diagnoseFileCorruptException: Corrupt DB, min key size violated
issues. If enabled, thebuild()
call will throw aFileCorruptException
if corruption is detected with details on which key/value is affected. #1143 - Admin: integer and floating point arrays introduced with the previous release are now nicely displayed and collapsed if long.
- Admin: the data table again displays all items of a page. #1135
- The
__cxa_pure_virtual
crash should not occur anymore; if you get related exceptions, they should contain additional information to better diagnose this issue. Let us know details in #1131 - Queries: all expected results are now returned when using a less-than or less-or-equal condition for a String property with index type
VALUE
. Reported via objectbox-dart#318 - Queries: when combining multiple conditions with OR and adding a condition on a related entity ("link condition") the combined conditions are now properly applied. Reported via objectbox-dart#546
- Some flags classes have moved to the new
config
package:io.objectbox.DebugFlags
is deprecated, useio.objectbox.config.DebugFlags
instead.io.objectbox.model.ValidateOnOpenMode
is deprecated, useio.objectbox.config.ValidateOnOpenModePages
instead.
-
Support for integer and floating point arrays: store
short[]
,char[]
,int[]
,long[]
andfloat[]
anddouble[]
(or their Kotlin counterparts, e.g.
FloatArray
) without a converter.A simple example is a shape entity that stores a palette of RGB colors:
@Entity public class Shape { @Id public long id; // An array of RGB color values that are used by this shape. public int[] palette; } // Find all shapes that use red in their palette try (Query<Shape> query = store.boxFor(Shape.class) .query(Shape_.palette.equal(0xFF0000)) .build()) { query.findIds(); }
This can also be useful to store vector embeddings produced by machine learning, e.g.:
@Entity public class ImageEmbedding { @Id public long id; // Link to the actual image, e.g. on Cloud storage public String url; // The coordinates computed for this image (vector embedding) public float[] coordinates; }
-
Fix incorrect Cursor code getting generated when using
@Convert
to convert to aString
array. -
The
io.objectbox.sync
plugin now also automatically adds a Sync-enabled JNI library on macOS and Windows (previously on Linux x64 only; still need to add manually for Linux on ARM).
- Fixes writes failing with "error code -30786", which may occur in some corner cases on some devices. #1099
- Add docs to
DbSchemaException
on how to resolve its typical causes.
This release includes breaking changes to generated code. If you encounter build errors, make sure to clean and build your project (e.g. Build > Rebuild project in Android Studio).
- Add
Query.copy()
andQueryThreadLocal
to obtain aQuery
instance to use in different threads. Learn more about re-using queries. #1071 - Add
relationCount
query condition to match objects that have a certain number of related objects pointing to them. E.g.Customer_.orders.relationCount(2)
will match all customers with two orders,Customer_.orders.relationCount(0)
will match all customers with no associated order. This can be useful to find objects where the relation was dissolved, e.g. after the related object was removed. - Allow using a relation target ID property with a property query. E.g.
query.property(Order_.customerId)
will map results to the ID of the customer of an order. #1028 - Add docs on
DbFullException
about why it occurs and how to handle it. - Do not fail to transform an entity class that contains a transient relation field when using Android Gradle Plugin 7.1 or lower.
- Restore compatibility for Android projects using Gradle 6.1. The minimum supported version for Gradle is 6.1 and for the Android Gradle Plugin 3.4. This should make it easier for older projects to update to the latest version of ObjectBox.
Using Sync? This release uses a new Sync protocol which improves efficiency. Reach out via your existing contact to check if any actions are required for your setup.
- Add
findFirstId()
andfindUniqueId()
toQuery
which just return the ID of a matching object instead of the full object. - Experimental support for setting a maximum data size via the
maxDataSizeInKByte
property when building a Store. This is different from the existingmaxSizeInKByte
property in that it is possible to remove data after reaching the limit and continue to use the database. See its documentation for more details. - Fix a crash when querying a value-based index (e.g.
@Index(type = IndexType.VALUE)
) on Android 32-bit ARM devices. #1105 - Various small improvements to the native libraries.
Using Sync? There is no Sync version for this release, please continue using version 3.2.1.
Note: V3.3.0 contains a bug preventing correct transformation of some classes, please use V3.3.1 instead.
- Gradle plugin: use new transform API with Android Plugin 7.2.0 and newer. Builds should be slightly faster as only entity and cursor classes and only incremental changes are transformed. #1078
- Gradle plugin: improve detection of applied Android plugins, improve registration of byte-code transform for non-Android Java projects, add check for minimum supported version of Gradle.
Using Sync? There is no Sync version for this release, please continue using version 3.2.1.
- Resolve an issue that prevented resources from getting cleaned up after closing
BoxStore
, causing the reference table to overflow when running many instrumentation tests on Android. #1080 - Plugin: support Kotlin 1.7. #1085
- Query: throw
IllegalStateException
when query is closed instead of crashing the virtual machine. #1081 - BoxStore and Query now throw
IllegalStateException
when trying to subscribe but the store or query is closed already. - Various internal improvements including minor optimizations for binary size and performance.
- The Data Browser has been renamed to ObjectBox Admin. Deprecated
AndroidObjectBrowser
, useAdmin
instead.AndroidObjectBrowser
will be removed in a future release. - Windows: using a database directory path that contains unicode (UTF-8) characters does not longer create an additional, unused, directory with garbled characters.
- Query: when using a negative offset or limit display a helpful error message.
- Processor: do not crash, but error if ToOne/ToMany type arguments are not supplied (e.g.
ToOne
instead ofToOne<Entity>
).
This release only contains bug fixes for the Android library when used with ObjectBox for Dart/Flutter.
- Fix incorrect unique constraint violation if an entity contains at least two unique properties with a certain combination of non-unique indexes.
- Data Browser/Admin: improved support when running multiple on the same host, but a different port (e.g.
localhost:8090
andlocalhost:8091
).
Read the blog post with more details and code examples for the new flex properties and query conditions.
- Support Flex properties. Expanding on the string and flexible map support in
3.0.0
, it is now possible to add a property usingObject
in Java orAny?
in Kotlin. These "flex properties" allow to store values of various types like integers, floating point values, strings and byte arrays. Or lists and maps (using string keys) of those. - The
containsElement
query condition now matches keys of string map properties. It also matches string or integer elements of a Flex list. - New
containsKeyValue
query condition to match key/value combinations of string map and Flex map properties containing strings and integers. Also added matchingQuery.setParameters
overload. - Add ProGuard/R8 rule to not warn about
SuppressFBWarnings
annotation. #1011 - Add more detailed error message when loading the native library fails on Android. #1024
- Data browser: byte arrays are now correctly displayed in Base64 encoding. #1033
- Add
BoxStore.awaitCallInTx
suspend function which wrapsBoxStore.callInTx
.
- Do not crash trying to add dependencies to Java desktop projects that only apply the Gradle
application
plugin.
{% hint style="info" %} 2021/10/19: Released version 3.0.1, which contains a fix for Android Java projects. {% endhint %}
-
A new Query API is available that works similar to the ObjectBox for Dart/Flutter Query API and makes it easier to create nested conditions. #201
// equal AND (less OR oneOf) val query = box.query( User_.firstName equal "Joe" and (User_.age less 12 or (User_.stamp oneOf longArrayOf(1012)))) .order(User_.age) .build()
-
For the existing Query API, String property conditions now require to explicitly specify case. See the documentation of
StringOrder
for which one to choose (typicallyStringOrder.CASE_INSENSITIVE
).// Replace String conditions like query().equal(User_.firstName, "Joe") // With the one accepting a StringOrder query().equal(User_.firstName, "Joe", StringOrder.CASE_INSENSITIVE)
-
Subscriptions now publish results in serial instead of in parallel (using a single thread vs. multiple threads per publisher). Publishing in parallel could previously lead to outdated results getting delivered after the latest results. As a side-effect transformers now run in serial instead of in parallel as well (on the same single thread per publisher). #793
-
Support annotating a single property with
@Unique(onConflict = ConflictStrategy.REPLACE)
to replace an existing Object if a conflict occurs when doing a put. #509@Entity data class Example( @Id var id: Long = 0, @Unique(onConflict = ConflictStrategy.REPLACE) var uniqueKey: String? = null )
-
Support
@Unsigned
to indicate that values of an integer property (e.g.Integer
andLong
in Java) should be treated as unsigned when doing queries or creating indexes. -
Store time in nanoseconds using the new
@Type
annotation for compatibility with other ObjectBox language bindings:@Type(DatabaseType.DateNano) var timeInNanos: Long;
-
Package FlatBuffers version into library to avoid conflicts with apps or other libraries using FlatBuffers. #894
-
Kotlin: add
Flow
extension functions forBoxStore
andQuery
. #900 -
Data browser: display query results if a property has a
NaN
value. #984 -
Android 12: support using Data Browser if targeting Android 12 (SDK 31). #1007
-
String arrays (Java
String[]
and KotlinArray<String>
) and lists (JavaList<String>
and KotlinMutableList<String>
). Using the newcontainsElement("item")
condition, it is also possible to query for entities where "item" is equal to one of the elements.@Entity data class Example( @Id var id: Long = 0, var stringArray: Array<String>? = null, var stringMap: MutableMap<String, String>? = null ) // matches [“first”, “second”, “third”] box.query(Example_.stringArray.containsElement(“second”)).build()
-
String maps (Java
Map<String, String>
or KotlinMutableMap<String, String>
). Stored internally as a byte array using FlexBuffers. -
Flexible maps:
- map keys must all have the same type,
- map keys or values must not be null,
- map values must be one of the supported database type, or a list of them (e.g. String, Boolean, Integer, Double, byte array...).
- The generated JSON model file no longer contains Java-specific flags that would lead to errors if used with Sync server.
- Additional checks when calling client or server methods.
Note: this is a preview release. Future releases may add, change or remove APIs.
- A new experimental Query API provides support for nested AND and OR conditions. #201
- Subscriptions now publish results in serial instead of in parallel (using a single thread vs. multiple threads per publisher). Publishing in parallel could previously lead to outdated results getting delivered after the latest results. As a side-effect transformers now run in serial instead of in parallel as well (on the same single thread per publisher). #793
- Add documentation that string property conditions ignore case by default. Point to using case-sensitive conditions for high-performance look-ups, e.g. when using string UIDs.
- Support annotating a single property with
@Unique(onConflict = ConflictStrategy.REPLACE)
to replace an existing Object if a conflict occurs when doing a put. #509 - Support
@Unsigned
to indicate that values of an integer property (e.g.Integer
andLong
in Java) should be treated as unsigned when doing queries or creating indexes. See the Javadoc of the annotation for more details. - Store time in nanoseconds by annotating a
Long
property with@Type(DatabaseType.DateNano)
. - Package FlatBuffers version into library to avoid conflicts if your code uses FlatBuffers as well. #894
- Kotlin: add Flow extension functions for BoxStore and Query. #900
- Data browser: display query results if a property has a NaN value. #984
New supported property types
When adding new properties, a converter is no longer necessary to store these types:
- String arrays (Java
String[]
and KotlinArray<String>
). Using the newcontainsElement("item")
condition, it is also possible to query for entities where "item" is equal to one of the array items. - String maps (Java
Map<String, String>
or KotlinMutableMap<String, String>
). Stored internally as a byte array using FlexBuffers.
Sync
- The generated JSON model file no longer contains Java-specific flags that would lead to errors if used with Sync server.
- Additional checks when calling client or server methods.
This is the first release available on the Central repository (Sonatype OSSRH). Make sure to adjust your build.gradle
files accordingly:
repositories {
mavenCentral()
}
Changes:
- Javadoc for
find(offset, limit)
ofQuery
is more concrete on how offset and limit work. - Javadoc for between conditions explicitly mentions it is inclusive of the two given values.
- Sync: Instead of the same name and a Maven classifier, Sync artifacts now use a different name. E.g.
objectbox-android:2.9.0:sync
is replaced withobjectbox-sync-android:2.9.1
.
-
Query: Add
lessOrEqual
andgreaterOrEqual
conditions for long, String, double and byte[] properties. -
Support Java applications on ARMv7 and AArch64 devices. #657
To use, add
implementation "io.objectbox:objectbox-linux-armv7:$objectboxVersion
orimplementation "io.objectbox:objectbox-linux-arm64:$objectboxVersion
to your dependencies. Otherwise the setup is identical with Java Desktop Apps. -
Resolve rare
ClassNotFoundException: kotlin.text.Charsets
when running processor. #946 -
Ensure Query setParameters works if running the x86 library on x64 devices (which could happen if ABI filters were set up incorrectly). #927
- Minor improvements to Sync tooling.
See the 2.8.0 release notes below for the latest changes.
- Added Sync API.
- Fixed "illegal reflective access" warning in the plugin.
- The data browser notification is now silent by default, for quieter testing. #903
- Updated and improved API documentation in various places (e.g. on how
Query.findLazy()
andQuery.findLazyCached()
work withLazyList
#906). - Print full name and link to element for
@Index
and@Id
errors. #902 - Explicitly allow to remove a
DbExceptionListener
by accepting null values forBoxStore.setDbExceptionListener(listener)
.
- Fix exception handling during
BoxStoreBuilder.build()
to allow retries. For example, after aFileCorruptException
you could try to open the database again using the recently addedusePreviousCommit()
option. - Add
PagesCorruptException
as a special case ofFileCorruptException
. DbExceptionListener
is called more robustly.
- Several database store improvements for
BoxStore
andBoxStoreBuilder
- New configuration options to open the database, e.g. a new read-only mode and using the previous data snapshot (second last commit) to potentially recover data.
- Database validation. We got a GitHub report indicating that some specific devices ship with a broken file system. While this is not a general concern (file systems should not be broken), we decided to detect some typical problems and provide some options to deal with these.
- Get the size on disk
- Add an efficient check if an object exist in a
Box
viacontains(id)
. - Android improvements
- Resolve Android Studio Build Analyzer warning about a prepare tasks not specifying outputs.
- Data Browser drawables are no longer packaged in the regular Android library. GitHub #857
- Fixes for one-to-many relations, e.g. allow removing both entity classes of a one-to-many relation. GitHub #859
@DefaultValue("")
annotation for properties to return an empty string instead of null. This is useful if a not-null property is added to an entity, but there are existing entities in the database that will return null for the new property. GH#157- RxJava 3 support library
objectbox-rxjava3
. Also includes Kotlin extension functions to more easily obtain Rx types, e.g. usequery.observable()
to get anObservable
. GH#83 - The annotation processor is incremental by default. GH#620
- Fix error handling if ObjectBox can't create a Java entity (the proper exception is now thrown).
- Support setting an alias after combining conditions using
and()
oror()
. GH#83 - Turn on incremental annotation processing by default. GH#620
- Add documentation that string property conditions ignore case by default. Point to using case-sensitive conditions for high-performance look-ups, e.g. when using string UIDs.
- Repository Artifacts are signed once again.
Changes since 2.6.0-RC (released on 2020/04/28):
- Performance improvements with query links (aka "joins").
Note: the order of results has changed unless you explicitly specified properties to order by. Remember: you should not depend on any internal order. If you did, this is a good time to fix it. objectbox-java
no longer exposes the greenrobot-essentials and FlatBuffers dependencies to consuming projects.- Minor code improvements.
Note: this is a preview release. Future releases may add, change or remove APIs.
- Add Kotlin infix extension functions for creating conditions using the new Query API. See the documentation for examples.
- The old Query API now also supports setting an alias after combining conditions using
and()
oror()
. GH#834 - Add documentation that string property conditions ignore case by default. Point to using case-sensitive conditions for high-performance look-ups, e.g. when using string UIDs.
- Java's
String[]
and Kotlin'sArray<String>
are now a supported database type. A converter is no longer necessary to store these types. Using thearrayProperty.equal("item")
condition, it is possible to query for entities where "item" is equal to one of the array items. - Support
@Unsigned
to indicate that values of an integer property (e.g.Integer
andLong
in Java) should be treated as unsigned when doing queries or creating indexes. See the Javadoc of the annotation for more details. - Add new library to support RxJava 3,
objectbox-rxjava3
. In additionobjectbox-kotlin
adds extension functions to more easily obtain Rx types, e.g. usequery.observable()
to get anObservable
. GH#839
To use this release change the version of objectbox-gradle-plugin
to 3.0.0-alpha2
. The plugin now properly adds the preview version of objectbox-java
to your dependencies.
buildscript {
dependencies {
classpath "io.objectbox:objectbox-gradle-plugin:3.0.0-alpha2"
}
}
dependencies {
// Artifacts with native code remain at 2.5.1.
implementation "io.objectbox:objectbox-android:2.5.1"
}
The objectbox-android
, objectbox-linux
, objectbox-macos
and objectbox-windows
artifacts shipping native code remain at version 2.5.1 as there have been no changes. If you explicitly include them, make sure to specify their version as 2.5.1
.
Note: this is a preview release. Future releases may add, change or remove APIs.
- A new Query API provides support for nested AND and OR conditions. See the documentation for examples and notable changes. GH#201
- Subscriptions now publish results in serial instead of in parallel (using a single thread vs. multiple threads per publisher). Publishing in parallel could previously lead to outdated results getting delivered after the latest results. As a side-effect transformers now run in serial instead of in parallel as well (on the same single thread per publisher). GH#793
- Turn on incremental annotation processing by default. GH#620
To use this release change the version of objectbox-gradle-plugin
to 3.0.0-alpha1
and add a dependency on objectbox-java
version 3.0.0-alpha1
.
buildscript {
dependencies {
classpath "io.objectbox:objectbox-gradle-plugin:3.0.0-alpha1"
}
}
dependencies {
implementation "io.objectbox:objectbox-java:3.0.0-alpha1"
// Artifacts with native code remain at 2.5.1.
implementation "io.objectbox:objectbox-android:2.5.1"
}
The objectbox-android
, objectbox-linux
, objectbox-macos
and objectbox-windows
artifacts shipping native code remain at version 2.5.1 as there have been no changes. However, if your project explicitly depends on them they will pull in version 2.5.1 of objectbox-java
. Make sure to add an explicit dependency on of objectbox-java
version 3.0.0-alpha1
as mentioned above.
- Support Android Gradle Plugin 3.6.0. GH#817
- Support for incremental annotation processing. GH#620 It is off by default. To turn it on set
objectbox.incremental
totrue
inbuild.gradle
:
android {
defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
arguments = [ "objectbox.incremental" : "true" ]
}
}
}
}
- Fixed corner case for N:M ToMany (not the backlinks for ToOne) returning wrong results
- Property queries compute sums and averages more precisely (improved algorithms and wider internal types)
- Query adds "describe" methods to obtain useful debugging information
- New method removeAllObjects() in BoxStore to clear the database of all data
- More helpful error messages if annotations can not be combined.
- Improved documentation on various annotations.
- Android: the AAR libraries ship Java 8 bytecode. Your app will not build unless you upgrade com.android.tools.build:gradle to 3.2.1 or later.
- Android: the ObjectBox LiveData and Paging integration migrated from Android Support Libraries to Jetpack (AndroidX) Libraries. If you are using them the library will not work unless you make the following changes in your app:
- Upgrade com.android.tools.build:gradle to 3.2.1 or later.
- Upgrade compileSdkVersion to 28 or later.
- Update your app to use Jetpack (AndroidX); follow the instructions in Migrating to AndroidX.
- Note: this version requires backwards-incompatible changes to the generated MyObjectBox file. Make sure to rebuild your project before running your app so the MyObjectBox file is re-generated.
V2.4.0 - 2019/10/15
- Class transformation works correctly if absolute path contains special characters. GH#135
V2.4.0-RC - Release Candidate 2019/10/03
- Box: add
getRelationEntities
,getRelationBacklinkEntities
,getRelationIds
andgetRelationBacklinkIds
to directly access relations without going through ToMany. - Box: add
putBatched
to put entities using a separate transaction for each batch. Box.removeByKeys()
is now deprecated; useremoveByIds()
instead.- Query: fixed performance regressions introduced in version 2.3 on 32 bit devices in combination with ordered results
- Fixed removing a relation and the related entity class. GH#490
- Resolved issue to enable query conditions on the target ID property of a ToOne relation. GH#537
- Box.getAll always returns a mutable list. GH#685
- Do not overwrite existing objectbox-java or objectbox-kotlin dependency. GH#693
- Resolved a corner case build time crash when parsing package elements. GH#698
- When trying to find an appropriate get-method for a property, also check if the return type matches the property type. GH#720
- Explicitly display an error if two entities with the same name are detected. GH#744
- The code in MyObjectBox is split up by entity to make it less likely to run into the Java method size limit when using many @Entity classes. GH#750
- Query: improved performance for ordered results with a limit. GH#769
- Query: throw if a filter is used incorrectly with count or remove. GH#771
- Documentation and internal improvements.
- Avoid UnsatisfiedLinkError on Android devices that are not identifying as Android correctly
- Fix displaying large objects in Object Browser 32 bit
- Kotlin properties starting with "is" of any type are detected
- Add
objectbox-kotlin
to dependencies ifkotlin-android
plugin is applied (previously only forkotlin
plugin) - @BaseEntity classes can be generic
- Fixed a bug introduced by V2.3.2 affecting older Android versions 4.3 and below
- Potential work around for UnsatisfiedLinkError probably caused by installation errors mostly in alternative app markets
- Support for Android Gradle Plugin 3.3.0: resolves deprecated API usage warnings.
- Fixed a corner case for Box.getAll() after removeAll() to return a stale object if no objects are stored
- Query improvements: findIds and LazyList also consider the order; offset and limit for findIds
- Improved 32 bit support: Windows 32 version officially deployed, fixed a corner case crash
- Property queries for a boolean property now allow sum()
- Added Box.isEmpty()
- Supporting older Linux distributions (now starting at e.g. Ubuntu 16.04 instead of 18.04)
- Fix for a corner case with Box.count() when using a maximum
- Minor improvements to the ObjectBox code generator
- Android: set extractNativeLibs to false to avoid issues with extracting the native library
Improvements & Fixes
-
Fix: the unique check for string properties had false positives resulting in UniqueViolationException. This occurs only in combination with IndexType.HASH (the default) when hashes actually collide. We advise to update immediately to the newest version if you are using hashed indexes.
-
The release of new ObjectBox C API made us change name of the JNI library
for better distinction. This should not affect you unless you depended on that (internal) name.
-
Improved compatibility with class transformers like Jacoco
-
Fixed query links for M:N backlinks
-
Improved error messages for the build tools
-
The Object Browser AAR now includes the required Android permissions
- Entity counts are now cached for better performance
- Deprecated aggregate function were removed (deprecation in 1.4 with introduction of PropertyQuery)
- Object browser hot fix: the hashed indexes introduced in 2.0 broke the object browser
- Object browser fixes: filters with long ints, improved performance in the schema view
- NPE fix in ToOne
- Added a specific NonUniqueResultException if a query did not return an expected unique result
ObjectBox 2.0 introduces index types for String. Before, every index used the property value for all look-ups. Now, ObjectBox can also use a hash to build an index. Because String
properties are typically taking more space than scalar values, ObjectBox switched the default index type to hash for strings.
When migrating data from pre-2.0 ObjectBox versions, for String properties with a plain @Index annotation this will update the indexes automatically: the old value-based indexes will be deleted and the new hash-bashed indexes will be built.
A side effect of this is that the database file might grow in the process. If you want to prevent this, you can instruct ObjectBox to keep using a value-based index for a String
property by specifying the index type
using @Index(type = IndexType.VALUE)
.
Other changes:
- Links and relation completeness and other features already announced in the 2.0 beta
- Unique constraint for properties via @Unique annotation
- Support for char type (16 bit)
- RX lib deployed in JCenter
- Rework of Query APIs: type safe properties (property now knows its owning entity)
- Allow query conditions of links using properties (without parameter alias)
- Query performance improvements when using order
- Property based count: query for non-null or unique occurrences of entity properties (non-null and unique)
- Additional query conditions for strings: "greater than", "less than", "in"
- Added query conditions for byte arrays
- Set query parameters for "in" condition (int[] and long[])
- Query across relation bounds using links (aka "join"): queries just got much more powerful. For example, query for orders that have a customer with an address on "Sesame Street". Or all persons, who have a grand parent called "Alice".
- Backlinks for to-many relations: now ObjectBox is "relation complete" with a bi-directional many-to-many relation.
- Query performance improvements: getting min/max values of indexed properties in constant time
- Android: added Paging library support (architecture components)
- Kotlin extensions: more Kotlin fun with ObjectBox KTX
- Query parameters aliases: helps setting query parameters in complex scenarios (e.g. for properties of linked entities)
- Improved query parameter verification
- Many internal improvements to keep us going fast in the future