/** * Adds elements to an ObjectStoreBag, delegate to internal ObjectStoreWriter. * * @param osb an ObjectStoreBag * @param query a Query * @throws ObjectStoreException if an error occurs */ public void addToBagFromQuery(ObjectStoreBag osb, Query query) throws ObjectStoreException { osw.addToBagFromQuery(osb, query); }
/** * Adds elements to an ObjectStoreBag, delegate to internal ObjectStoreWriter. * * @param osb an ObjectStoreBag * @param query a Query * @throws ObjectStoreException if an error occurs */ public void addToBagFromQuery(ObjectStoreBag osb, Query query) throws ObjectStoreException { osw.addToBagFromQuery(osb, query); }
private void cloneInternalObjectStoreBag(InterMineBag bag) { ObjectStoreWriter osw = null; try { osw = os.getNewWriter(); ObjectStoreBag newBag = osw.createObjectStoreBag(); Query q = new Query(); q.addToSelect(this.osb); osw.addToBagFromQuery(newBag, q); bag.osb = newBag; } catch (ObjectStoreException e) { LOG.error("Clone failed.", e); throw new RuntimeException("Clone failed.", e); } finally { try { if (osw != null) { osw.close(); } } catch (ObjectStoreException e) { LOG.error("Closing object store failed.", e); } } }
private void cloneInternalObjectStoreBag(InterMineBag bag) { ObjectStoreWriter osw = null; try { osw = os.getNewWriter(); ObjectStoreBag newBag = osw.createObjectStoreBag(); Query q = new Query(); q.addToSelect(this.osb); osw.addToBagFromQuery(newBag, q); bag.osb = newBag; } catch (ObjectStoreException e) { LOG.error("Clone failed.", e); throw new RuntimeException("Clone failed.", e); } finally { try { if (osw != null) { osw.close(); } } catch (ObjectStoreException e) { LOG.error("Closing object store failed.", e); } } }
/** * Add elements to the bag from a query, this is able to operate entirely in the database * without needing to read objects into memory. The query should have a single column on the * select list returning an object id. * @param query to select object ids * @throws ObjectStoreException if problem storing */ public void addToBagFromQuery(Query query) throws ObjectStoreException { // query is checked in ObjectStoreWriter method ObjectStoreWriter oswProduction = null; try { oswProduction = os.getNewWriter(); oswProduction.addToBagFromQuery(osb, query); } finally { if (oswProduction != null) { oswProduction.close(); } } if (profileId != null) { updateBagValues(); } }
/** * Add elements to the bag from a query, this is able to operate entirely in the database * without needing to read objects into memory. The query should have a single column on the * select list returning an object id. * @param query to select object ids * @throws ObjectStoreException if problem storing */ public void addToBagFromQuery(Query query) throws ObjectStoreException { // query is checked in ObjectStoreWriter method ObjectStoreWriter oswProduction = null; try { oswProduction = os.getNewWriter(); oswProduction.addToBagFromQuery(osb, query); } finally { if (oswProduction != null) { oswProduction.close(); } } if (profileId != null) { updateBagValues(); } }
ObjectStoreBag osb2 = storeDataWriter.createObjectStoreBag(); storeDataWriter.addToBag(osb2, ((Employee) data.get("EmployeeA1")).getId()); storeDataWriter.addToBagFromQuery(osb2, q); q = new Query(); q.addToSelect(osb2);