Skip to content

Commit f892349

Browse files
committed
Merge branch 'dev' into main
2 parents b3d53ac + 1e51085 commit f892349

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2393
-183
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<img width="466" src="https://raw.githubusercontent.com/objectbox/objectbox-java/master/logo.png">
22

3-
[![Follow ObjectBox on Twitter](https://img.shields.io/twitter/follow/ObjectBox_io.svg?style=flat-square&logo=twitter&color=fff)](https://twitter.com/ObjectBox_io)
3+
[![Follow ObjectBox on Twitter](https://img.shields.io/twitter/follow/ObjectBox_io.svg?style=flat-square&logo=twitter)](https://twitter.com/intent/follow?screen_name=ObjectBox_io)
44

55
# ObjectBox Java (Kotlin, Android)
66
ObjectBox is a superfast object-oriented database with strong relation support.
77
ObjectBox is embedded into your Android, Linux, macOS, or Windows app.
88

9-
**Latest version: [2.7.1 (2020/08/19)](https://docs.objectbox.io/#objectbox-changelog)**
9+
**Latest version: [2.8.0 (2020/11/04)](https://docs.objectbox.io/#objectbox-changelog)**
1010

1111
Demo code using ObjectBox:
1212

@@ -33,7 +33,7 @@ Add this to your root build.gradle (project level):
3333

3434
```groovy
3535
buildscript {
36-
ext.objectboxVersion = '2.7.1'
36+
ext.objectboxVersion = '2.8.0'
3737
dependencies {
3838
classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"
3939
}

build.gradle

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
buildscript {
22
ext {
33
// Typically, only edit those two:
4-
def objectboxVersionNumber = '2.7.1' // without "-SNAPSHOT", e.g. '2.5.0' or '2.4.0-RC'
4+
def objectboxVersionNumber = '2.8.0' // without "-SNAPSHOT", e.g. '2.5.0' or '2.4.0-RC'
55
def objectboxVersionRelease = true // set to true for releasing to ignore versionPostFix to avoid e.g. "-dev" versions
66

77
// version post fix: '-<value>' or '' if not defined; e.g. used by CI to pass in branch name
@@ -19,9 +19,10 @@ buildscript {
1919
: 'unsupported'
2020
ob_native_dep = "io.objectbox:objectbox-$objectboxPlatform:$nativeVersion"
2121

22-
junit_version = '4.13'
22+
essentials_version = '3.1.0'
23+
junit_version = '4.13.1'
2324
mockito_version = '3.3.3'
24-
kotlin_version = '1.3.72'
25+
kotlin_version = '1.4.10'
2526
dokka_version = '0.10.1'
2627

2728
println "version=$ob_version"
@@ -39,7 +40,8 @@ buildscript {
3940
dependencies {
4041
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
4142
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
42-
classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.0.5"
43+
// https://github.com/spotbugs/spotbugs-gradle-plugin/releases
44+
classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.5.1"
4345
}
4446
}
4547

@@ -113,7 +115,7 @@ configure(subprojects.findAll { projectNamesToPublish.contains(it.name) }) {
113115

114116
if (preferredRepo == 'local') {
115117
repository url: repositories.mavenLocal().url
116-
println "Uploading archives to mavenLocal()."
118+
println "uploadArchives repo is mavenLocal()."
117119
} else if (preferredRepo != null
118120
&& project.hasProperty('preferredUsername')
119121
&& project.hasProperty('preferredPassword')) {
@@ -131,7 +133,7 @@ configure(subprojects.findAll { projectNamesToPublish.contains(it.name) }) {
131133
authentication(userName: preferredUsername, password: preferredPassword)
132134
}
133135

134-
println "Uploading archives to $repositoryUrl."
136+
println "uploadArchives repo is $repositoryUrl."
135137
} else if (project.hasProperty('sonatypeUsername')
136138
&& project.hasProperty('sonatypePassword')) {
137139
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
@@ -144,9 +146,9 @@ configure(subprojects.findAll { projectNamesToPublish.contains(it.name) }) {
144146
authentication(userName: sonatypeUsername, password: sonatypePassword)
145147
}
146148

147-
println "Uploading archives to $sonatypeRepositoryUrl."
149+
println "uploadArchives repo is $sonatypeRepositoryUrl."
148150
} else {
149-
println "WARNING: preferredRepo or credentials NOT set, can not upload archives."
151+
println "WARNING: uploadArchives settings incomplete, can not upload archives."
150152
}
151153

152154
pom.project {

gradle/wrapper/gradle-wrapper.jar

509 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ esac
8282

8383
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
8484

85+
8586
# Determine the Java command to use to start the JVM.
8687
if [ -n "$JAVA_HOME" ] ; then
8788
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
129130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133+
132134
JAVACMD=`cygpath --unix "$JAVACMD"`
133135

134136
# We build the pattern for arguments to be converted via cygpath

gradlew.bat

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4040

4141
set JAVA_EXE=java.exe
4242
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4444

4545
echo.
4646
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +54,7 @@ goto fail
5454
set JAVA_HOME=%JAVA_HOME:"=%
5555
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5656

57-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5858

5959
echo.
6060
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,28 +64,14 @@ echo location of your Java installation.
6464

6565
goto fail
6666

67-
:init
68-
@rem Get command-line arguments, handling Windows variants
69-
70-
if not "%OS%" == "Windows_NT" goto win9xME_args
71-
72-
:win9xME_args
73-
@rem Slurp the command line arguments.
74-
set CMD_LINE_ARGS=
75-
set _SKIP=2
76-
77-
:win9xME_args_slurp
78-
if "x%~1" == "x" goto execute
79-
80-
set CMD_LINE_ARGS=%*
81-
8267
:execute
8368
@rem Setup the command line
8469

8570
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8671

72+
8773
@rem Execute Gradle
88-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
8975

9076
:end
9177
@rem End local scope for the variables with windows NT shell

objectbox-java-api/src/main/java/io/objectbox/annotation/BaseEntity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
import java.lang.annotation.Target;
77

88
/**
9-
* Annotation for an entity base class.
10-
* ObjectBox will include properties of an entity super class marked with this annotation.
9+
* Marks a class as an ObjectBox Entity super class.
10+
* ObjectBox will store properties of this class as part of an Entity that inherits from this class.
11+
* See <a href="https://docs.objectbox.io/advanced/entity-inheritance">the Entity Inheritance documentation</a> for details.
1112
*/
1213
@Retention(RetentionPolicy.CLASS)
1314
@Target(ElementType.TYPE)

objectbox-java-api/src/main/java/io/objectbox/annotation/Convert.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,29 @@
1616

1717
package io.objectbox.annotation;
1818

19-
import io.objectbox.converter.PropertyConverter;
20-
2119
import java.lang.annotation.ElementType;
2220
import java.lang.annotation.Retention;
2321
import java.lang.annotation.RetentionPolicy;
2422
import java.lang.annotation.Target;
2523

24+
import io.objectbox.converter.PropertyConverter;
25+
2626
/**
27-
* Specifies {@link PropertyConverter} for the field to support custom types
27+
* Supplies a {@link PropertyConverter converter} to store custom Property types as a supported {@link #dbType()}.
28+
* See the <a href="https://docs.objectbox.io/advanced/custom-types">Custom Types documentation</a> for details.
2829
*/
2930
@Retention(RetentionPolicy.CLASS)
3031
@Target(ElementType.FIELD)
3132
public @interface Convert {
32-
/** Converter class */
33+
/**
34+
* The converter class that ObjectBox should use. See {@link PropertyConverter} for implementation guidelines.
35+
*/
3336
Class<? extends PropertyConverter> converter();
3437

3538
/**
36-
* Class of the DB type the Java property is converted to/from.
37-
* This is limited to all java classes which are supported natively by ObjectBox.
39+
* The Property type the Java field value is converted to/from.
40+
* See the <a href="https://docs.objectbox.io/advanced/custom-types">Custom Types documentation</a> for a list
41+
* of supported types.
3842
*/
3943
Class dbType();
4044
}

objectbox-java-api/src/main/java/io/objectbox/annotation/Entity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import java.lang.annotation.Target;
2323

2424
/**
25-
* Annotation for entities
26-
* ObjectBox only persist objects of classes which are marked with this annotation
25+
* Marks a class as an ObjectBox Entity.
26+
* Allows to obtain a Box for this Entity from BoxStore to persist Objects of this class.
2727
*/
2828
@Retention(RetentionPolicy.CLASS)
2929
@Target(ElementType.TYPE)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package io.objectbox.annotation;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
/**
9+
* Enables sync for an {@link Entity} class.
10+
* <p>
11+
* Note that currently sync can not be enabled or disabled for existing entities.
12+
* Also synced entities can not have relations to non-synced entities.
13+
*/
14+
@Retention(RetentionPolicy.CLASS)
15+
@Target(ElementType.TYPE)
16+
public @interface Sync {
17+
}

objectbox-java-api/src/main/java/io/objectbox/annotation/apihint/Temporary.java

Lines changed: 0 additions & 32 deletions
This file was deleted.

objectbox-java-api/src/main/java/io/objectbox/annotation/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
/**
1818
* Annotations to mark a class as an {@link io.objectbox.annotation.Entity @Entity},
19-
* to specify the {@link io.objectbox.annotation.Id @Id} property,
19+
* to specify the {@link io.objectbox.annotation.Id @Id} Property,
2020
* to create an {@link io.objectbox.annotation.Index @Index} or
21-
* a {@link io.objectbox.annotation.Transient @Transient} property.
21+
* a {@link io.objectbox.annotation.Transient @Transient} Property.
2222
* <p>
2323
* For more details look at the documentation of individual classes and
2424
* <a href="https://docs.objectbox.io/entity-annotations">docs.objectbox.io/entity-annotations</a>.

objectbox-java-api/src/main/java/io/objectbox/converter/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/**
1818
* For use with {@link io.objectbox.annotation.Convert @Convert}: {@link io.objectbox.converter.PropertyConverter}
19-
* to convert custom property types.
19+
* to convert custom Property types.
2020
* <p>
2121
* For more details look at the documentation of individual classes and
2222
* <a href="https://docs.objectbox.io/advanced/custom-types">docs.objectbox.io/advanced/custom-types</a>.

objectbox-java/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ ext {
1010

1111
dependencies {
1212
api project(':objectbox-java-api')
13-
implementation 'org.greenrobot:essentials:3.0.0-RC1'
13+
implementation "org.greenrobot:essentials:$essentials_version"
1414
implementation 'com.google.flatbuffers:flatbuffers-java:1.12.0'
1515
api 'com.google.code.findbugs:jsr305:3.0.2'
1616

17-
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.0.4'
17+
// https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md
18+
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.1.4'
1819
}
1920

2021
spotbugs {

objectbox-java/src/main/java/io/objectbox/Box.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@
3939
import io.objectbox.relation.RelationInfo;
4040

4141
/**
42-
* A box to store objects of a particular class.
42+
* A Box to put and get Objects of a specific Entity class.
4343
* <p>
4444
* Thread-safe.
4545
*/
46-
@Beta
4746
@ThreadSafe
4847
@SuppressWarnings("WeakerAccess,UnusedReturnValue,unused")
4948
public class Box<T> {

0 commit comments

Comments
 (0)