ProjectDatabase { public int storeObjects(Collection<? extends Storable> storables, boolean allowUpdate) { return this.entityStore.computeInTransaction( txn -> { int success = 0; for (Storable s : storables) { if (putObject(s, allowUpdate, txn) != -1) { success++; } } return success; }); } private  ProjectDatabase(); static synchronized ProjectDatabase getInstance(); static void reset(); @SuppressWarnings("try") static void setSerializeBlobData(Entity entity, String prop, Object obj); boolean execute(Function<StoreTransaction, Boolean> fn); R computeInReadonly(Function<StoreTransaction, R> fn); long storeObject(Storable s); @SuppressWarnings("try") long storeObject(Storable s, boolean allowUpdate); void asyncStoreObject(Storable s, boolean allowUpdate); void asyncStoreObjects(Collection<? extends Storable> storables, boolean allowUpdate); int storeObjects(Collection<? extends Storable> storables, boolean allowUpdate); T loadObject(String entityType, String id, Class<T> clazz); boolean deleteObject(String entityType, String id); List<U> find(
      String entityType,
      String propName,
      String value,
      Function<? super Entity, ? extends U> mapper); Optional<U> findOne(
      String entityType,
      String propName,
      String value,
      Function<? super Entity, ? extends U> mapper); List<U> findStartingWith(
      String entityType,
      String propName,
      String value,
      Function<? super Entity, ? extends U> mapper); @SuppressWarnings("rawtypes") List<U> findRange(
      String entityType,
      String propName,
      Comparable min,
      Comparable max,
      Function<? super Entity, ? extends U> mapper); void findAll(String entityType, Consumer<Entity> consumer); void findAllObject(String entityType, Class<T> clazz, Consumer<T> consumer); long size(String entityName); void shutdown(); ExecutorService getExecutorService(); File getBaseLocation(); static final String ID; static final String SERIALIZE_KEY; }
@Test public void testStore03() throws Exception { String name = "java.lang.String"; ClassIndex ci = null; int count = 100; List<ClassIndex> lst = new ArrayList<>(); for (int i = 0; i < count; i++) { ClassIndex c = new ClassIndex(name + i, Collections.emptyList(), Collections.emptyList()); lst.add(c); } long l = database.storeObjects(lst, true); lst.forEach( c -> { System.out.println(c.getEntityId()); }); }