@@ -64,9 +64,9 @@ public class BoxStore implements Closeable {
64
64
@ Nullable public static Object relinker ;
65
65
66
66
/** Change so ReLinker will update native library when using workaround loading. */
67
- public static final String JNI_VERSION = "2.4.0 " ;
67
+ public static final String JNI_VERSION = "2.4.1 " ;
68
68
69
- private static final String VERSION = "2.4.0 -2019-10-03 " ;
69
+ private static final String VERSION = "2.4.1 -2019-10-29 " ;
70
70
private static BoxStore defaultStore ;
71
71
72
72
/** Currently used DB dirs with values from {@link #getCanonicalPath(File)}. */
@@ -999,4 +999,23 @@ long panicModeRemoveAllObjects(int entityId) {
999
999
return nativePanicModeRemoveAllObjects (handle , entityId );
1000
1000
}
1001
1001
1002
+ /**
1003
+ * If you want to use the same ObjectBox store using the C API, e.g. via JNI, this gives the required pointer,
1004
+ * which you have to pass on to obx_store_wrap().
1005
+ * The procedure is like this:<br>
1006
+ * 1) you create a BoxStore on the Java side<br>
1007
+ * 2) you call this method to get the native store pointer<br>
1008
+ * 3) you pass the native store pointer to your native code (e.g. via JNI)<br>
1009
+ * 4) your native code calls obx_store_wrap() with the native store pointer to get a OBX_store pointer<br>
1010
+ * 5) Using the OBX_store pointer, you can use the C API.
1011
+ *
1012
+ * Note: Once you {@link #close()} this BoxStore, do not use it from the C API.
1013
+ */
1014
+ public long getNativeStore () {
1015
+ if (closed ) {
1016
+ throw new IllegalStateException ("Store must still be open" );
1017
+ }
1018
+ return handle ;
1019
+ }
1020
+
1002
1021
}
0 commit comments