Skip to content

Releases: objectbox/objectbox-java

V3.5.1

21 Mar 07:17
Compare
Choose a tag to compare
  • 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.

We're hiring! 😎 We believe resource-efficient coding is still cool and are looking for a C / C++ developer who shares our sentiment.

V3.5.0

07 Dec 15:18
Compare
Choose a tag to compare

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() and QueryThreadLocal to obtain a Query 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.

V3.4.0

18 Oct 14:31
Compare
Choose a tag to compare
  • Add findFirstId() and findUniqueId() to Query 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 existing maxSizeInKByte 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.

V3.3.1

06 Sep 09:24
Compare
Choose a tag to compare

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.
  • Various small improvements to the native libraries.

Using Sync? There is no Sync version for this release, please continue using version 3.2.1.

V3.2.1

05 Jul 17:17
Compare
Choose a tag to compare
  • 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

V3.2.0

21 Jun 09:11
Compare
Choose a tag to compare
  • 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.

V3.1.3

11 May 08:06
Compare
Choose a tag to compare
  • 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 of ToOne<Entity>).
  • The Data Browser has been renamed to ObjectBox Admin. Deprecated AndroidObjectBrowser, use Admin instead. AndroidObjectBrowser will be removed in a future release.

V3.1.2

22 Feb 13:19
Compare
Choose a tag to compare

This release only contains bug fixes for the Android library when used with ObjectBox for Dart/Flutter.

V3.1.1

26 Jan 13:13
Compare
Choose a tag to compare

This release only contains bug fixes.

  • 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 and localhost:8091).

V3.1.0

10 Jan 13:01
Compare
Choose a tag to compare

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 using Object in Java or Any? in Kotlin. These "flex properties" now 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. Some limitations apply, see the FlexObjectConverter class documentation for details.
    @Entity
    data class Customer(
        @Id var id: Long = 0,
        var tag: Any? = null
    )
    
    val customerStrTag = Customer(tag = "string-tag")
    val customerIntTag = Customer(tag = 1234)
    box.put(customerStrTag, customerIntTag)
  • 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 matching Query.setParameters overload.
    val customer = Customer(
        properties = mutableMapOf("premium" to "tier-1")
    )
    box.put(customer)
    
    // Query for any customers that have a premium key in their properties map
    val queryPremiumAll = box.query(
        Customer_.properties.containsElement("premium")
    ).build()
    
    // Match only customers with specific key and value map entry
    val queryPremiumTier1 = box.query(
        Customer_.properties.containsKeyValue("premium", "tier-1")
    ).build()
  • 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

Kotlin

  • Add BoxStore.awaitCallInTx suspend function which wraps BoxStore.callInTx.

Gradle plugin

  • Do not crash trying to add dependencies to Java desktop projects that only apply the Gradle application plugin.

Read more in the docs