public <T extends IObject> T updateObject(T... objs) { T result = iUpdate.saveAndReturnObject(objs[0]); iUpdate.flush(); // was commit return result; } }, job);
@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); }
public void runAsAdmin() { final Share share = iQuery.get(Share.class, shareId); CommentAnnotation comment = new CommentAnnotation(); comment.setTextValue(commentText); comment.setNs(NS_COMMENT); share.linkAnnotation(comment); iUpdate.flush(); rv[0] = iQuery.get(CommentAnnotation.class, comment.getId()); }});
public void runAsAdmin() { String dsQuery; if (force) { dsQuery = dsNotOwnQuery; p.addLong("owner", iAdmin.getEventContext().getCurrentUserId()); } else { dsQuery = dsAllQuery; } rv.addAll(iQuery.findAllByQuery(dsQuery, p)); // TODO What about categories of other users? }
/** * Provides an {@link EventContext} instance without reloading the session, * via {@link LocalAdmin#getEventContextQuiet()}. * @return the event context */ public EventContext getEventContext() { final LocalAdmin admin = (LocalAdmin) sf.getAdminService(); final EventContext ec = admin.getEventContextQuiet(); return ec; } }
@RolesAllowed("user") public List<Experimenter> lookupExperimenters() { return iQuery.findAllByQuery("select distinct e from Experimenter e " + "left outer join fetch e.groupExperimenterMap m " + "left outer join fetch m.parent g", null); }
public IObject updateObject(IObject... iObjects) { return up.saveAndReturnObject(iObjects[0]); } }, newEnum);
public E call(IObject object) { iQuery.evict(object); return (E) object; }; }
public void runAsAdmin() { iQuery.execute(new HibernateCallback<Object>() { public Object doInHibernate(org.hibernate.Session s) throws HibernateException, SQLException { Query q = qb.query(s); List<Object[]> results = q.list(); if (results.size() != shareIds.size()) { throw new ValidationException( "Missing or protected shares specified"); } for (Object[] values : results) { Long shareId = (Long) values[0]; Long count = (Long) values[1]; rv.put(shareId, count); } return null; }}); }}); return rv;
/** * Implemented as specified by the {@link RenderingEngine} interface. * * @see RenderingEngine#getCompressionLevel() */ @RolesAllowed("user") public float getCompressionLevel() { return compressionSrv.getCompressionLevel(); }
/** * Implemented as specified by the {@link RenderingEngine} interface. * * @see LocalCompress#setCompressionLevel(float) */ @RolesAllowed("user") public void setCompressionLevel(float percentage) { compressionSrv.setCompressionLevel(percentage); }
protected String idToUuid(long shareId) { Session s = iQuery.get(Session.class, shareId); return s.getUuid(); }
public void runAsAdmin() { iUpdate.flush(); } });
public void runAsAdmin() { iUpdate.deleteObject(e); } });
@RolesAllowed("user") public List<ExperimenterGroup> lookupGroups() { return iQuery.findAllByQuery("select distinct g from ExperimenterGroup g " + "left outer join fetch g.groupExperimenterMap m " + "left outer join fetch m.child u " + "left outer join fetch u.groupExperimenterMap m2 " + "left outer join fetch m2.parent", null); }
public void runAsAdmin() { iUpdate.flush(); } });
public void runAsAdmin() { iUpdate.deleteObject(g); } });
public <T extends IObject> T updateObject(T... objs) { iUpdate.flush(); return null; }}, copy); }
public void runAsAdmin() { iUpdate.flush(); } });