Support
Quality
Security
License
Reuse
kandi has reviewed objectbox-java and discovered the below as its top functions. This is intended to give you an instant insight into objectbox-java implemented functionality, and help decide if they suit your requirements.
🏁 High performance on restricted devices, like IoT gateways, micro controllers, ECUs etc. 🪂 Resourceful with minimal CPU, power and Memory usage for maximum flexibility and sustainability 🔗 Relations: object links / relationships are built-in 💻 Multiplatform: Linux, Windows, Android, iOS, macOS. 🌱 Scalable: handling millions of objects resource-efficiently with ease 💐 Queries: filter data as needed, even across relations 🦮 Statically typed: compile time checks & optimizations 📃 Automatic schema migrations: no update scripts needed. And much more than just data persistence 👥 ObjectBox Sync: keeps data in sync between devices and servers 🕒 ObjectBox TS: time series extension for time based data.
ObjectBox Java (Kotlin, Android)
// Kotlin
val playlist = Playlist("My Favorites")
playlist.songs.add(Song("Lalala"))
playlist.songs.add(Song("Lololo"))
box.put(playlist)
Gradle setup
buildscript {
ext.objectboxVersion = "3.1.2"
repositories {
mavenCentral()
}
dependencies {
classpath("io.objectbox:objectbox-gradle-plugin:$objectboxVersion")
}
}
First steps
// Kotlin
@Entity data class Playlist( ... )
// Java
@Entity public class Playlist { ... }
License
Copyright 2017-2022 ObjectBox Ltd. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
How to query for relations that are empty?
final noToOneTargetQuery = box.query(Entity_.toOne.equals(0)).build();
QUESTION
How to query for relations that are empty?
Asked 2022-Feb-14 at 06:29I have two classes with one-to-many relation:
@Entity()
class Lesson {
final course = ToOne<Course>();
}
@Entity()
class Course {
@Backlink('course')
final lessons = ToMany<Lesson>();
}
I want to query for all lessons that does not belong to any course. Below does not work:
final qb = _box.query(Lesson_.course.isNull());
And the reason is explained in this issue.
So I have to do this:
final qb = _box.query(Lesson_.course.equals(0));
Is there a better or a recommended way for this?
ANSWER
Answered 2022-Feb-14 at 06:29Yes, for ObjectBox for Dart adding an equals 0 condition on the ToOne is the way to find objects without a ToOne target:
final noToOneTargetQuery = box.query(Entity_.toOne.equals(0)).build();
See ObjectBox for Dart test code for more.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
Explore Related Topics
Save this library and start creating your kit