/** * Adds a collection of elements to an ObjectStoreBag, delegate to internal ObjectStoreWriter. * * @param osb an ObjectStoreBag * @param coll a Collection of Integers * @throws ObjectStoreException if an error occurs */ public void addAllToBag(ObjectStoreBag osb, Collection<Integer> coll) throws ObjectStoreException { osw.addAllToBag(osb, coll); }
/** * Adds a collection of elements to an ObjectStoreBag, delegate to internal ObjectStoreWriter. * * @param osb an ObjectStoreBag * @param coll a Collection of Integers * @throws ObjectStoreException if an error occurs */ public void addAllToBag(ObjectStoreBag osb, Collection<Integer> coll) throws ObjectStoreException { osw.addAllToBag(osb, coll); }
try { oswProduction = os.getNewWriter(); oswProduction.addAllToBag(osb, ids); } finally { if (oswProduction != null) {
try { oswProduction = os.getNewWriter(); oswProduction.addAllToBag(osb, ids); } finally { if (oswProduction != null) {
/** * Upgrades the ObjectStoreBag with a new ObjectStoreBag containing the collection of elements * given in input * @param values the collection of elements to add * @param updateBagValues id true if we upgrade the bagvalues table * @throws ObjectStoreException if an error occurs fetching a new ID */ public void upgradeOsb(Collection<Integer> values, boolean updateBagValues) throws ObjectStoreException { ObjectStoreWriter oswProduction = null; SavedBag savedBag = (SavedBag) uosw.getObjectById(savedBagId, SavedBag.class); try { oswProduction = os.getNewWriter(); osb = oswProduction.createObjectStoreBag(); oswProduction.addAllToBag(osb, values); savedBag.setOsbId(osb.getBagId()); savedBag.setState(BagState.CURRENT.toString()); state = BagState.CURRENT; uosw.store(savedBag); if (updateBagValues) { updateBagValues(); } } finally { if (oswProduction != null) { oswProduction.close(); } } }
/** * Upgrades the ObjectStoreBag with a new ObjectStoreBag containing the collection of elements * given in input * @param values the collection of elements to add * @param updateBagValues id true if we upgrade the bagvalues table * @throws ObjectStoreException if an error occurs fetching a new ID */ public void upgradeOsb(Collection<Integer> values, boolean updateBagValues) throws ObjectStoreException { ObjectStoreWriter oswProduction = null; SavedBag savedBag = (SavedBag) uosw.getObjectById(savedBagId, SavedBag.class); try { oswProduction = os.getNewWriter(); osb = oswProduction.createObjectStoreBag(); oswProduction.addAllToBag(osb, values); savedBag.setOsbId(osb.getBagId()); savedBag.setState(BagState.CURRENT.toString()); state = BagState.CURRENT; uosw.store(savedBag); if (updateBagValues) { updateBagValues(); } } finally { if (oswProduction != null) { oswProduction.close(); } } }
coll.add(new Integer(30)); storeDataWriter.beginTransaction(); storeDataWriter.addAllToBag(osb, coll); Query q = new Query(); q.addToSelect(osb);