@Test public void testUpdate() throws Exception { final MachineResourceReference machineResourceReference = new MachineResourceReference("1"); assertFalse(machineResourceReferenceDao.update(machineResourceReference, WriteConcern.NONE)); machineResourceReferenceDao.create(machineResourceReference, WriteConcern.NONE); final MachineResourceReference updatedProcessingLimits = new MachineResourceReference(machineResourceReference.getId()); assertTrue(machineResourceReferenceDao.update(updatedProcessingLimits, WriteConcern.NONE)); machineResourceReferenceDao.delete(updatedProcessingLimits.getId()); }
@Override public boolean update(MachineResourceReference machineResourceReference, WriteConcern writeConcern) { if(read(machineResourceReference.getId()) != null) { datastore.save(machineResourceReference, writeConcern); return true; } return false; }
MachineResourceReferenceDaoImpl implements MachineResourceReferenceDao { @Override public boolean update(MachineResourceReference machineResourceReference, WriteConcern writeConcern) { if(read(machineResourceReference.getId()) != null) { datastore.save(machineResourceReference, writeConcern); return true; } return false; } }
MachineResourceReferenceDaoImpl implements MachineResourceReferenceDao { @Override public boolean update(MachineResourceReference machineResourceReference, WriteConcern writeConcern) { if(read(machineResourceReference.getId()) != null) { datastore.save(machineResourceReference, writeConcern); return true; } return false; } MachineResourceReferenceDaoImpl(Datastore datastore); }
MachineResourceReferenceDaoImpl implements MachineResourceReferenceDao { @Override public boolean update(MachineResourceReference machineResourceReference, WriteConcern writeConcern) { if(read(machineResourceReference.getId()) != null) { datastore.save(machineResourceReference, writeConcern); return true; } return false; } MachineResourceReferenceDaoImpl(Datastore datastore); @Override Long getCount(); @Override boolean create(MachineResourceReference machineResourceReference, WriteConcern writeConcern); @Override com.google.code.morphia.Key<MachineResourceReference> createOrModify(MachineResourceReference machineResourceReference, WriteConcern writeConcern); @Override Iterable<com.google.code.morphia.Key<MachineResourceReference>> createOrModify(Collection<MachineResourceReference> machineResourceReferences, WriteConcern writeConcern); @Override MachineResourceReference read(String id); @Override boolean update(MachineResourceReference machineResourceReference, WriteConcern writeConcern); @Override WriteResult delete(String id); @Override List<MachineResourceReference> getAllMachineResourceReferences(Page page); }
MachineResourceReferenceDaoImpl implements MachineResourceReferenceDao { @Override public boolean update(MachineResourceReference machineResourceReference, WriteConcern writeConcern) { if(read(machineResourceReference.getId()) != null) { datastore.save(machineResourceReference, writeConcern); return true; } return false; } MachineResourceReferenceDaoImpl(Datastore datastore); @Override Long getCount(); @Override boolean create(MachineResourceReference machineResourceReference, WriteConcern writeConcern); @Override com.google.code.morphia.Key<MachineResourceReference> createOrModify(MachineResourceReference machineResourceReference, WriteConcern writeConcern); @Override Iterable<com.google.code.morphia.Key<MachineResourceReference>> createOrModify(Collection<MachineResourceReference> machineResourceReferences, WriteConcern writeConcern); @Override MachineResourceReference read(String id); @Override boolean update(MachineResourceReference machineResourceReference, WriteConcern writeConcern); @Override WriteResult delete(String id); @Override List<MachineResourceReference> getAllMachineResourceReferences(Page page);  }