@Override public void runAsAdmin() { update.flush(); }}); return s;
/** * Delete a data object. * @param row the object to delete * @param options the parameters to apply (ignored) */ private void deleteDataObject(IObject row, Parameters options) { iUpdate.deleteObject(row); }
@Override @RolesAllowed("user") @Transactional(readOnly = false) public IObject[] updateDataObjects(IObject[] arg0, Parameters arg1) { return iUpdate.saveAndReturnArray(arg0); }
public <T extends IObject> T updateObject(T... objs) { T result = iUpdate.saveAndReturnObject(objs[0]); iUpdate.flush(); // was commit return result; } }, job);
public IObject updateObject(IObject... iObjects) { return up.saveAndReturnObject(iObjects[0]); } }, newEnum);
@RolesAllowed("system") @Transactional(readOnly = false) @Deprecated public void setDN(Long experimenterID, String dn) { Experimenter experimenter = iQuery.get(Experimenter.class, experimenterID); experimenter.setLdap(StringUtils.isNotBlank(dn)); iUpdate.saveObject(experimenter); }
@RolesAllowed("system") @Transactional(readOnly = false) public <T extends IEnum> void updateEnumerations(List<T> listEnum) { // should be changed to saveAndReturnCollection(Collection graph) // when method is implemented Collection<IObject> colEnum = new ArrayList<IObject>(); for (Object o : listEnum) { IObject obj = (IObject) o; colEnum.add(obj); } iUpdate.saveCollection(colEnum); }
public void save() throws Exception { if (!initialized) { throw new ApiUsageException(null, null, "Not initialized"); } // // First save the rois, so that if it fails, no changes will be // made to the table // List<IObject> unsaved = new ArrayList<IObject>(); for (Map.Entry<String, IObject> entry : lsidMap.entrySet()) { unsaved.add(entry.getValue()); } if (unsaved.size() > 0) { IObject[] objs = unsaved.toArray(new IObject[unsaved.size()]); List<Long> ids = update.saveAndReturnIds(objs); for (int i = 0; i < ids.size(); i++) { unsaved.get(i).setId(ids.get(i)); unsaved.get(i).unload(); roiIds.add(ids.get(i)); } } // Now fill the columns with data, and send to the table instance cols.fill(rows); table.addData(cols.asArray()); rows = null; }
@RolesAllowed("user") @Transactional(readOnly = false) public void createThumbnails() { try { List<Thumbnail> thumbnails = ctx.loadAllMetadata(pixelsId); for (Thumbnail thumbnail : thumbnails) { thumbnailMetadata = thumbnail; _createThumbnail(); } // We're doing the update or creation and save as a two step // process due to the possible unloaded Pixels. If we do not, // Pixels will be unloaded and we will hit // IllegalStateException's when checking update events. iUpdate.saveArray(thumbnails.toArray( new Thumbnail[thumbnails.size()])); // Ensure that we do not have "dirty" pixels or rendering settings // left around in the Hibernate session cache. iQuery.clear(); } finally { dirtyMetadata = false; } }
@RolesAllowed("system") @Transactional(readOnly = false) public <T extends IEnum> T updateEnumeration(T oEnum) { return iUpdate.saveAndReturnObject(oEnum); }
/** * Creates the thumbnail or retrieves it from cache and updates the * thumbnail metadata. * @return Thumbnail bytes. */ private byte[] retrieveThumbnailAndUpdateMetadata(boolean rewriteMetadata) { byte[] thumbnail = retrieveThumbnail(rewriteMetadata); if (inProgress && !PROGRESS_VERSION.equals(thumbnailMetadata)) { thumbnailMetadata.setVersion(PROGRESS_VERSION); dirtyMetadata = true; } if (dirtyMetadata) { try { iUpdate.saveObject(thumbnailMetadata); } finally { dirtyMetadata = false; } } return thumbnail; }
if (toSave.size() > 0) iUpdate.saveCollection(toSave); return toReturn;
public <T extends IObject> T updateObject(T... objs) { iUpdate.flush(); return null; }}, copy); }
@RolesAllowed("user") @Transactional(readOnly = false) public void saveRndSettings(RenderingDef rndSettings) { iUpdate.saveAndReturnObject(rndSettings); }
public void runAsAdmin() { iUpdate.deleteObject(e); } });
@Override @RolesAllowed("user") @Transactional(readOnly = false) public IObject[] createDataObjects(IObject[] arg0, Parameters arg1) { return iUpdate.saveAndReturnArray(arg0); }
@RolesAllowed("user") @Transactional(readOnly = false) public void changeOwner(IObject iObject, String omeName) { // should take an Owner IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = userProxy(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy); }
if (toSave.size() > 0) iUpdate.saveCollection(toSave); s1.stop(); return toReturn;
public void runAsAdmin() { iUpdate.flush(); } });