GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add Box.get(long[] ids) · bobbisinaga/objectbox-java@a2e0e12

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • objectbox-java/src/main/java/io/objectbox
    • Box.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/Box.java
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,27 @@ public List<T> get(Iterable<Long> ids) {
216216
return list;
217217
}
218218

219+
/**
220+
* Get the stored objects for the given IDs.
221+
*
222+
* @return null if not found
223+
*/
224+
public List<T> get(long[] ids) {
225+
ArrayList<T> list = new ArrayList<>(ids.length);
226+
Cursor<T> reader = getReader();
227+
try {
228+
for (Long id : ids) {
229+
T entity = reader.get(id);
230+
if (entity != null) {
231+
list.add(entity);
232+
}
233+
}
234+
} finally {
235+
releaseReader(reader);
236+
}
237+
return list;
238+
}
239+
219240
/**
220241
* Get the stored objects for the given IDs as a Map with IDs as keys, and entities as values.
221242
* IDs for which no entity is found will be put in the map with null values.
@@ -560,6 +581,21 @@ public void attach(T entity) {
560581
}
561582
}
562583

584+
// Sketching future API extension
585+
private boolean isEmpty() {
586+
return false;
587+
}
588+
589+
// Sketching future API extension
590+
private boolean isChanged(T entity) {
591+
return false;
592+
}
593+
594+
// Sketching future API extension
595+
private boolean putIfChanged(T entity) {
596+
return false;
597+
}
598+
563599
public Class<T> getEntityClass() {
564600
return entityClass;
565601
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.