You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Notable changes to the ObjectBox Java library.
4
4
5
5
For more insights into what changed in the ObjectBox C++ core, [check the ObjectBox C changelog](https://github.com/objectbox/objectbox-c/blob/main/CHANGELOG.md).
6
6
7
-
## 4.2.1 - in development
7
+
## 4.3.0 - 2025-05-13
8
8
9
9
- Basic support for boolean array properties (`boolean[]` in Java or `BooleanArray` in Kotlin).
Copy file name to clipboardExpand all lines: README.md
+104-45
Original file line number
Diff line number
Diff line change
@@ -29,32 +29,68 @@ Store and manage data effortlessly in your Android or JVM Linux, macOS or Window
29
29
Easily manage vector data alongside your objects and perform superfast on-device vector search to empower your apps with RAG AI, generative AI, and similarity search.
30
30
Enjoy exceptional speed, battery-friendly resource usage, and environmentally-friendly development. 💚
31
31
32
-
## Demo code
32
+
ObjectBox provides a store with boxes to put objects into:
33
+
34
+
#### JVM + Java example
33
35
34
36
```java
35
-
// Java
36
-
Playlist playlist =newPlaylist("My Favorites");
37
-
playlist.songs.add(newSong("Lalala"));
38
-
playlist.songs.add(newSong("Lololo"));
39
-
box.put(playlist);
37
+
// Annotate a class to create a Box
38
+
@Entity
39
+
publicclassPerson {
40
+
private@Idlong id;
41
+
privateString firstName;
42
+
privateString lastName;
43
+
44
+
// Constructor, getters and setters left out for simplicity
45
+
}
46
+
47
+
BoxStore store =MyObjectBox.builder()
48
+
.name("person-db")
49
+
.build();
50
+
51
+
Box<Person> box = store.boxFor(Person.class);
52
+
53
+
Person person =newPerson("Joe", "Green");
54
+
long id = box.put(person); // Create
55
+
person = box.get(id); // Read
56
+
person.setLastName("Black");
57
+
box.put(person); // Update
58
+
box.remove(person); // Delete
40
59
```
41
60
42
-
➡️ [More details in the docs](https://docs.objectbox.io/)
61
+
#### Android + Kotlin example
43
62
44
63
```kotlin
45
-
// Kotlin
46
-
val playlist =Playlist("My Favorites")
47
-
playlist.songs.add(Song("Lalala"))
48
-
playlist.songs.add(Song("Lololo"))
49
-
box.put(playlist)
64
+
// Annotate a class to create a Box
65
+
@Entity
66
+
data classPerson(
67
+
@Id varid:Long = 0,
68
+
varfirstName:String? = null,
69
+
varlastName:String? = null
70
+
)
71
+
72
+
val store =MyObjectBox.builder()
73
+
.androidContext(context)
74
+
.build()
75
+
76
+
val box = store.boxFor(Person::class)
77
+
78
+
var person =Person(firstName ="Joe", lastName ="Green")
79
+
val id = box.put() // Create
80
+
person = box.get(id) // Read
81
+
person.lastName ="Black"
82
+
box.put(person) // Update
83
+
box.remove(person) // Delete
50
84
```
51
85
86
+
Continue with the ➡️ **[Getting Started guide](https://docs.objectbox.io/getting-started)**.
87
+
52
88
## Table of Contents
53
89
54
90
-[Key Features](#key-features)
55
91
-[Getting started](#getting-started)
56
92
-[Gradle setup](#gradle-setup)
57
-
-[First steps](#first-steps)
93
+
-[Maven setup](#maven-setup)
58
94
-[Why use ObjectBox?](#why-use-objectbox-for-java-data-management)
59
95
-[Community and Support](#community-and-support)
60
96
-[Changelog](#changelog)
@@ -73,11 +109,12 @@ box.put(playlist)
73
109
74
110
### Gradle setup
75
111
76
-
For Android projects, add the ObjectBox Gradle plugin to your root `build.gradle`:
112
+
For Gradle projects, add the ObjectBox Gradle plugin to your root Gradle script:
77
113
78
-
```groovy
114
+
```kotlin
115
+
// build.gradle.kts
79
116
buildscript {
80
-
ext.objectboxVersion = "4.2.0"
117
+
valobjectboxVersion by extra("4.3.0")
81
118
repositories {
82
119
mavenCentral()
83
120
}
@@ -87,47 +124,69 @@ buildscript {
87
124
}
88
125
```
89
126
90
-
And in your app's `build.gradle` apply the plugin:
127
+
<details><summary>Using plugins syntax</summary>
91
128
92
-
```groovy
93
-
// Using plugins syntax:
129
+
```kotlin
130
+
//build.gradle.kts
94
131
plugins {
95
-
id("io.objectbox") // Add after other plugins.
132
+
id("com.android.application") version "8.0.2" apply false// When used in an Android project
133
+
id("io.objectbox") version "4.3.0" apply false
96
134
}
97
-
98
-
// Or using the old apply syntax:
99
-
apply plugin: "io.objectbox" // Add after other plugins.
Your project can now use ObjectBox, continue by [defining entity classes](https://docs.objectbox.io/getting-started#define-entity-classes).
184
+
185
+
### Maven setup
127
186
128
-
The `Box` object gives you access to all major functions, like `put`, `get`, `remove`, and `query`.
187
+
This is currently only supported for JVM projects.
129
188
130
-
For details please check the [docs](https://docs.objectbox.io).
189
+
To set up a Maven project, see the [README of the Java Maven example project](https://github.com/objectbox/objectbox-examples/blob/main/java-main-maven/README.md).
131
190
132
191
## Why use ObjectBox for Java data management?
133
192
@@ -171,7 +230,7 @@ challenges in everyday app development?
0 commit comments