Java and Android Database - fast and lightweight without any ORM
inMemory()
when building a BoxStore
:
store = MyObjectBox.builder()
.androidContext(context)
.inMemory("test-db")
.build();
See the BoxStoreBuilder.inMemory()
documentation for details.BoxStore.deleteAllFiles()
to support deleting an in-memory database.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.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.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
__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
VALUE
. Reported via objectbox-dart#318
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.Support for integer and floating point arrays: store
short[]
, char[]
, int[]
, long[]
andfloat[]
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.
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.
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).
Query.copy()
and QueryThreadLocal
to obtain a Query
instance to use in different threads. Learn more about re-using queries. #1071relationCount
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.query.property(Order_.customerId)
will map results to the ID of the customer of an order. #1028DbFullException
about why it occurs and how to handle it.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.
findFirstId()
and findUniqueId()
to Query
which just return the ID of a matching object instead of the full object.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.@Index(type = IndexType.VALUE)
) on Android 32-bit ARM devices. #1105Using 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.
Using Sync? There is no Sync version for this release, please continue using version 3.2.1.
BoxStore
, causing the reference table to overflow when running many instrumentation tests on Android. #1080IllegalStateException
when query is closed instead of crashing the virtual machine. #1081IllegalStateException
when trying to subscribe but the store or query is closed already.