@Override @DB() public int update(final T entity, final SearchCriteria<T> sc) { final UpdateBuilder ub = getUpdateBuilder(entity); return update(ub, sc, null); }
@Override public boolean update(String id, ItWorkVO work) { work.setUpdatedAt(InaccurateClock.getTimeInSeconds()); return super.update(id, work); }
@DB() public int update(final T entity, final SearchCriteria<T> sc, Integer rows) { final UpdateBuilder ub = getUpdateBuilder(entity); return update(ub, sc, rows); }
@Override @DB() public boolean update(ID id, T entity) { assert Enhancer.isEnhanced(entity.getClass()) : "Entity is not generated by this dao"; UpdateBuilder ub = getUpdateBuilder(entity); boolean result = update(id, ub, entity) != 0; return result; }
@Override public boolean update(Long id, NetworkACLItemVO item) { boolean result = super.update(id, item); _networkACLItemCidrsDao.updateCidrs(item.getId(), item.getSourceCidrList()); return result; }
@Override public int remove(SearchCriteria<T> sc) { if (_removeSql == null) { return expunge(sc); } T vo = createForUpdate(); UpdateBuilder ub = getUpdateBuilder(vo); ub.set(vo, _removed.second(), new Date()); return update(ub, sc, null); }
@Override public boolean updateState(final State currentState, final Event event, final State nextState, final Network vo, final Object data) { // TODO: ensure this update is correct final TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); final NetworkVO networkVo = (NetworkVO)vo; networkVo.setState(nextState); super.update(networkVo.getId(), networkVo); txn.commit(); return true; }
@Override public boolean updateState(State currentState, Event event, State nextState, SnapshotVO snapshot, Object data) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); SnapshotVO snapshotVO = snapshot; snapshotVO.setState(nextState); super.update(snapshotVO.getId(), snapshotVO); txn.commit(); return true; }
@Override @DB public boolean update(Long zoneId, EngineDataCenterVO zone) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); boolean persisted = super.update(zoneId, zone); if (!persisted) { return persisted; } saveDetails(zone); txn.commit(); return persisted; }
@Override @DB public boolean update(Long zoneId, DataCenterVO zone) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); boolean persisted = super.update(zoneId, zone); if (!persisted) { return persisted; } saveDetails(zone); txn.commit(); return persisted; }
throw new CloudRuntimeException("How can it be illegal access...come on", e); update(id, entity); return entity;
@Override @DB public boolean update(final Long networkId, final NetworkVO network, final Map<String, String> serviceProviderMap) { final TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); super.update(networkId, network); if (serviceProviderMap != null) { _ntwkSvcMap.deleteByNetworkId(networkId); persistNetworkServiceProviders(networkId, serviceProviderMap); } txn.commit(); return true; }
@Override @DB public boolean update(Long hostId, EngineHostVO host) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); boolean persisted = super.update(hostId, host); if (!persisted) { return persisted; } saveDetails(host); saveHostTags(host); txn.commit(); return persisted; }
protected int update(ID id, UpdateBuilder ub, T entity) { if (_cache != null) { _cache.remove(id); } SearchCriteria<T> sc = createSearchCriteria(); sc.addAnd(_idAttributes.get(_table)[0], SearchCriteria.Op.EQ, id); TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); try { if (ub.getCollectionChanges() != null) { insertElementCollection(entity, _idAttributes.get(_table)[0], id, ub.getCollectionChanges()); } } catch (SQLException e) { throw new CloudRuntimeException("Unable to persist element collection", e); } int rowsUpdated = update(ub, sc, null); txn.commit(); return rowsUpdated; }
@Override @DB public boolean update(Long hostId, HostVO host) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); boolean persisted = super.update(hostId, host); if (!persisted) { return persisted; } saveDetails(host); saveHostTags(host); saveGpuRecords(host); txn.commit(); return persisted; }
@DB() public int update(final T entity, final SearchCriteria<T> sc, final Integer rows) { final UpdateBuilder ub = getUpdateBuilder(entity); return update(ub, sc, rows); }
@Override @DB() public int update(final T entity, final SearchCriteria<T> sc) { final UpdateBuilder ub = getUpdateBuilder(entity); return update(ub, sc, null); }
@Override @DB() public boolean update(final ID id, final T entity) { assert Enhancer.isEnhanced(entity.getClass()) : "Entity is not generated by this dao"; final UpdateBuilder ub = getUpdateBuilder(entity); final boolean result = update(id, ub, entity) != 0; return result; }
@Override public int remove(final SearchCriteria<T> sc) { if (_removeSql == null) { return expunge(sc); } final T vo = createForUpdate(); final UpdateBuilder ub = getUpdateBuilder(vo); ub.set(vo, _removed.second(), new Date()); return update(ub, sc, null); }
protected int update(final ID id, final UpdateBuilder ub, final T entity) { if (_cache != null) { _cache.remove(id); } final SearchCriteria<T> sc = createSearchCriteria(); sc.addAnd(_idAttributes.get(_table)[0], SearchCriteria.Op.EQ, id); final TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); try { if (ub.getCollectionChanges() != null) { insertElementCollection(entity, _idAttributes.get(_table)[0], id, ub.getCollectionChanges()); } } catch (final SQLException e) { throw new CloudRuntimeException("Unable to persist element collection", e); } final int rowsUpdated = update(ub, sc, null); txn.commit(); return rowsUpdated; }