Objectbox Java Versions Save

Java and Android Database - fast and lightweight without any ORM

V3.8.0

1 month ago
  • Support creating file-less in-memory databases, e.g. for caching and testing. To create one use inMemory() when building a BoxStore:
    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 existing maxSizeInKByte() 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 https://docs.objectbox.io/advanced/custom-types
  • Restore compatibility with Kotlin 1.5. However, need to exclude kotlin-stdlib 1.8 from objectbox-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.

V3.7.1

4 months ago
  • 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.

V3.7.0

7 months ago
  • A new key/value validation option validateOnOpenKv() is available on MyObjectBox.builder() to help diagnose FileCorruptException: Corrupt DB, min key size violated issues. If enabled, the build() call will throw a FileCorruptException 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, use io.objectbox.config.DebugFlags instead.
    • io.objectbox.model.ValidateOnOpenMode is deprecated, use io.objectbox.config.ValidateOnOpenModePages instead.

V3.6.0

10 months ago
  • Support for integer and floating point arrays: store

    • short[], char[], int[], long[] and
    • float[] and double[]

    (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 a String 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).

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.1

1 year ago
  • 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

1 year ago

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

1 year ago
  • 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

1 year ago

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

1 year ago
  • 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

1 year ago
  • 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.