@Test public void testUpdateDetached() { Session session = getSession(); Experiment experiment = BeanFactory.getExperimentServiceBean().findByID(6); removeSession(session); session = getSession(); Experiment newExperiment = BeanFactory.getExperimentServiceBean().findByID(6); assertFalse(experiment == newExperiment); experiment.setTitle("New Title"); Experiment attachedNewly = BeanFactory.getExperimentServiceBean().updateDetached(experiment); assertEquals("New Title", attachedNewly.getTitle()); removeSession(session); session = getSession(); Experiment updatedExperiment = BeanFactory.getExperimentServiceBean().findByID(6); assertEquals("New Title", updatedExperiment.getTitle()); removeSession(session); BasicTestDatabaseCreatorWrapper.markDatabaseChanged(); }
@Override public Experiment updateDetached(Experiment experiment) { return experimentDAO.updateDetached(experiment); }
ExperimentServiceImpl implements ExperimentService { @Override public Experiment updateDetached(Experiment experiment) { return experimentDAO.updateDetached(experiment); } }
ExperimentServiceImpl implements ExperimentService { @Override public Experiment updateDetached(Experiment experiment) { return experimentDAO.updateDetached(experiment); } ExperimentServiceImpl(); }
ExperimentServiceImpl implements ExperimentService { @Override public Experiment updateDetached(Experiment experiment) { return experimentDAO.updateDetached(experiment); } ExperimentServiceImpl(); @Override void setExperimentDAO(ExperimentDAO experimentDAO); void setFileDAO(FileDAO fileDAO); @Override Integer insert(Experiment experiment); @Override void update(Experiment experiment); @Override void merge(Experiment experiment); @Override void delete(Experiment experiment, boolean deleteRealFiles); @Override List<Experiment> list(Registration registration); @Override List<Experiment> list(Study study); @Override List<File> getFiles(Integer experimentId); @Override boolean isHasFile(Integer experimentId); @Override List<File> getFiles(Integer studyId, String metaType); @Override boolean isHasFile(Integer studyId, String metaType); @Override SortedSet<Experiment> setWithHasFile(SortedSet<Experiment> list); @Override SortedSet<Experiment> listWithHasFile(SortedSet<Experiment> list, String metaType); @Override Experiment findByTitle(String title); @Override Experiment findByID(Integer expID); @Override Experiment findBySWAccession(Integer swAccession); @Override boolean hasTitleBeenUsed(String oldTitle, String newTitle); @Override Experiment updateDetached(Experiment experiment); @Override List<Experiment> findByOwnerID(Integer registrationID); @Override List<Experiment> findByCriteria(String criteria, boolean isCaseSens); @Override List<Experiment> list(); @Override void update(Registration registration, Experiment experiment); @Override Integer insert(Registration registration, Experiment experiment); @Override Experiment updateDetached(Registration registration, Experiment experiment); }
ExperimentServiceImpl implements ExperimentService { @Override public Experiment updateDetached(Experiment experiment) { return experimentDAO.updateDetached(experiment); } ExperimentServiceImpl(); @Override void setExperimentDAO(ExperimentDAO experimentDAO); void setFileDAO(FileDAO fileDAO); @Override Integer insert(Experiment experiment); @Override void update(Experiment experiment); @Override void merge(Experiment experiment); @Override void delete(Experiment experiment, boolean deleteRealFiles); @Override List<Experiment> list(Registration registration); @Override List<Experiment> list(Study study); @Override List<File> getFiles(Integer experimentId); @Override boolean isHasFile(Integer experimentId); @Override List<File> getFiles(Integer studyId, String metaType); @Override boolean isHasFile(Integer studyId, String metaType); @Override SortedSet<Experiment> setWithHasFile(SortedSet<Experiment> list); @Override SortedSet<Experiment> listWithHasFile(SortedSet<Experiment> list, String metaType); @Override Experiment findByTitle(String title); @Override Experiment findByID(Integer expID); @Override Experiment findBySWAccession(Integer swAccession); @Override boolean hasTitleBeenUsed(String oldTitle, String newTitle); @Override Experiment updateDetached(Experiment experiment); @Override List<Experiment> findByOwnerID(Integer registrationID); @Override List<Experiment> findByCriteria(String criteria, boolean isCaseSens); @Override List<Experiment> list(); @Override void update(Registration registration, Experiment experiment); @Override Integer insert(Registration registration, Experiment experiment); @Override Experiment updateDetached(Registration registration, Experiment experiment);  }