GeezerVison is showing github.com — Remove unused Cursor/Box based find methods. · mimoccc/objectbox-java@26a91cd
File treeExpand file treeCollapse file tree Open diff view settings objectbox-java/src/main/java/io/objectbox tests/objectbox-java-test/src/test/java/io/objectbox
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/Box.java -20Lines changed: 0 additions & 20 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -298,26 +298,6 @@ public boolean isEmpty() { | 298 | 298 | return count(1) == 0; | 299 | 299 | } | 300 | 300 |
| 301 | | -// @Temporary | 302 | | -// public List<T> find(Property property, String value) { | 303 | | -// Cursor<T> reader = getReader(); | 304 | | -// try { | 305 | | -// return reader.find(property, value); | 306 | | -// } finally { | 307 | | -// releaseReader(reader); | 308 | | -// } | 309 | | -// } | 310 | | -// | 311 | | -// @Temporary | 312 | | -// public List<T> find(Property property, long value) { | 313 | | -// Cursor<T> reader = getReader(); | 314 | | -// try { | 315 | | -// return reader.find(property, value); | 316 | | -// } finally { | 317 | | -// releaseReader(reader); | 318 | | -// } | 319 | | -// } | 320 | | - | 321 | 301 | /** | 322 | 302 | * Returns all stored Objects in this Box. | 323 | 303 | */ | |
Collapse file Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/Cursor.java -14Lines changed: 0 additions & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -60,10 +60,6 @@ public abstract class Cursor<T> implements Closeable { | 60 | 60 |
| 61 | 61 | static native long nativeCount(long cursor, long maxCountOrZero); | 62 | 62 |
| 63 | | - static native List nativeFindScalarPropertyId(long cursor, int propertyId, long value); | 64 | | - | 65 | | - static native List nativeFindStringPropertyId(long cursor, int propertyId, String value); | 66 | | - | 67 | 63 | // TODO not implemented | 68 | 64 | static native long nativeGetKey(long cursor); | 69 | 65 |
| @@ -235,16 +231,6 @@ public int getPropertyId(String propertyName) { | 235 | 231 | return nativePropertyId(cursor, propertyName); | 236 | 232 | } | 237 | 233 |
| 238 | | -// @Temporary | 239 | | -// public List<T> find(Property property, long value) { | 240 | | -// return nativeFindScalarPropertyId(cursor, property.id, value); | 241 | | -// } | 242 | | -// | 243 | | -// @Temporary | 244 | | -// public List<T> find(Property property, String value) { | 245 | | -// return nativeFindStringPropertyId(cursor, property.id, value); | 246 | | -// } | 247 | | - | 248 | 234 | /** | 249 | 235 | * @return key or 0 if not found | 250 | 236 | * @deprecated TODO only used in tests, remove in the future | |
Collapse file Copy file name to clipboardExpand all lines: tests/objectbox-java-test/src/test/java/io/objectbox/BoxTest.java -24Lines changed: 0 additions & 24 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -245,30 +245,6 @@ public void testCollectionsNull() { | 245 | 245 | box.removeByKeys(null); | 246 | 246 | } | 247 | 247 |
| 248 | | -// @Test | 249 | | -// public void testFindString() { | 250 | | -// putTestEntity("banana", 0); | 251 | | -// putTestEntity("apple", 0); | 252 | | -// putTestEntity("banana", 0); | 253 | | -// | 254 | | -// List<TestEntity> list = box.find(TestEntity_.simpleString, "banana"); | 255 | | -// assertEquals(2, list.size()); | 256 | | -// assertEquals(1, list.get(0).getId()); | 257 | | -// assertEquals(3, list.get(1).getId()); | 258 | | -// } | 259 | | -// | 260 | | -// @Test | 261 | | -// public void testFindInt() { | 262 | | -// putTestEntity(null, 42); | 263 | | -// putTestEntity(null, 23); | 264 | | -// putTestEntity(null, 42); | 265 | | -// | 266 | | -// List<TestEntity> list = box.find(TestEntity_.simpleInt, 42); | 267 | | -// assertEquals(2, list.size()); | 268 | | -// assertEquals(1, list.get(0).getId()); | 269 | | -// assertEquals(3, list.get(1).getId()); | 270 | | -// } | 271 | | - | 272 | 248 | @Test | 273 | 249 | public void testGetId() { | 274 | 250 | TestEntity entity = putTestEntity(null, 42); | |
Collapse file Copy file name to clipboardExpand all lines: tests/objectbox-java-test/src/test/java/io/objectbox/CursorTest.java -58Lines changed: 0 additions & 58 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -160,59 +160,6 @@ public void testPutSameIndexValue() { | 160 | 160 | assertEquals(value, read.getSimpleString()); | 161 | 161 | } | 162 | 162 |
| 163 | | -// @Test | 164 | | -// public void testFindStringInEntity() { | 165 | | -// insertTestEntities("find me", "not me"); | 166 | | -// | 167 | | -// Transaction transaction = store.beginTx(); | 168 | | -// Cursor<TestEntity> cursor = transaction.createCursor(TestEntity.class); | 169 | | -// TestEntity entityRead = cursor.find(TestEntity_.simpleString, "find me").get(0); | 170 | | -// assertNotNull(entityRead); | 171 | | -// assertEquals(1, entityRead.getId()); | 172 | | -// | 173 | | -// cursor.close(); | 174 | | -// transaction.abort(); | 175 | | -// | 176 | | -// transaction = store.beginTx(); | 177 | | -// cursor = transaction.createCursor(TestEntity.class); | 178 | | -// entityRead = cursor.find(TestEntity_.simpleString, "not me").get(0); | 179 | | -// assertNotNull(entityRead); | 180 | | -// assertEquals(2, entityRead.getId()); | 181 | | -// | 182 | | -// cursor.close(); | 183 | | -// transaction.abort(); | 184 | | -// | 185 | | -// transaction = store.beginTx(); | 186 | | -// cursor = transaction.createCursor(TestEntity.class); | 187 | | -// assertEquals(0, cursor.find(TestEntity_.simpleString, "non-existing").size()); | 188 | | -// | 189 | | -// cursor.close(); | 190 | | -// transaction.abort(); | 191 | | -// } | 192 | | - | 193 | | -// @Test | 194 | | -// public void testFindScalars() { | 195 | | -// Transaction transaction1 = store.beginTx(); | 196 | | -// Cursor<TestEntity> cursor1 = transaction1.createCursor(TestEntity.class); | 197 | | -// putEntity(cursor1, "nope", 2015); | 198 | | -// putEntity(cursor1, "foo", 2016); | 199 | | -// putEntity(cursor1, "bar", 2016); | 200 | | -// putEntity(cursor1, "nope", 2017); | 201 | | -// cursor1.close(); | 202 | | -// transaction1.commit(); | 203 | | -// | 204 | | -// Transaction transaction = store.beginReadTx(); | 205 | | -// Cursor<TestEntity> cursor = transaction.createCursor(TestEntity.class); | 206 | | -// List<TestEntity> result = cursor.find(TestEntity_.simpleInt, 2016); | 207 | | -// assertEquals(2, result.size()); | 208 | | -// | 209 | | -// assertEquals("foo", result.get(0).getSimpleString()); | 210 | | -// assertEquals("bar", result.get(1).getSimpleString()); | 211 | | -// | 212 | | -// cursor.close(); | 213 | | -// transaction.abort(); | 214 | | -// } | 215 | | - | 216 | 163 | private void insertTestEntities(String... texts) { | 217 | 164 | Transaction transaction = store.beginTx(); | 218 | 165 | Cursor<TestEntity> cursor = transaction.createCursor(TestEntity.class); | @@ -223,11 +170,6 @@ private void insertTestEntities(String... texts) { | 223 | 170 | transaction.commitAndClose(); | 224 | 171 | } | 225 | 172 |
| 226 | | -// @Test | 227 | | -// public void testFindStringInEntityWithIndex() { | 228 | | -// testFindStringInEntity(); | 229 | | -// } | 230 | | - | 231 | 173 | @Test | 232 | 174 | public void testLookupKeyUsingIndex() throws IOException { | 233 | 175 | insertTestEntities("find me", "not me"); | |
|