We’re happy to announce 1.4 of our superfast mobile database that comes with three new features:

  • Queries may now return values for an individual property (also supports distinct values)
  • Entities may extend other entities
  • 50% size reduction of native library

Property queries were one of the most requested features in the last months. They do not to return entire objects but only one property of the entity. This can be much more efficient and convenient. For example, you may only need the email adresses of all users entity:

An important aspect of querying individual properties are distinct values. For example, let’s query all the different (distinct) first names users have (“Joe” will be returned only once regardless of how many users are named “Joe”):

The API also let’s you configure the behavior in regards to null values and string case sensitivity. Check the JavaDocs of PropertyQuery for details.

Entity inheritance is the other new major functionality. You can now define persistent properties in super classes annotated with @Entity or the new @BaseEntity. The following example illustrates how to define a base class for all shapes including properties for a bounding box:

For more details and current restrictions, please check the entity inheritance docs.

And last but not least, we halfed the size of ObjectBox native libraries! The size of the AAR went down from 2,523 KB in V1.3.4 to 1,553 KB (38% reduction of the compressed archive containing 4 ABIs). We’re very happy about this, because we are dedicated to keep ObjectBox as fast and lean as possible.

Spread the love