@Test void testAddWithIdentifier() { MappingProject mappingProject = new MappingProject("My first mapping project", 3); mappingProject.setIdentifier("mappingProjectID"); try { mappingProjectRepositoryImpl.add(mappingProject); } catch (MolgenisDataException mde) { assertEquals("MappingProject already exists", mde.getMessage()); } }
@Override @Transactional public void add(MappingProject mappingProject) { if (mappingProject.getIdentifier() != null) { throw new MolgenisDataException("MappingProject already exists"); } dataService.add(MAPPING_PROJECT, toEntity(mappingProject)); }
MappingProjectRepositoryImpl implements MappingProjectRepository { @Override @Transactional public void add(MappingProject mappingProject) { if (mappingProject.getIdentifier() != null) { throw new MolgenisDataException("MappingProject already exists"); } dataService.add(MAPPING_PROJECT, toEntity(mappingProject)); } }
MappingProjectRepositoryImpl implements MappingProjectRepository { @Override @Transactional public void add(MappingProject mappingProject) { if (mappingProject.getIdentifier() != null) { throw new MolgenisDataException("MappingProject already exists"); } dataService.add(MAPPING_PROJECT, toEntity(mappingProject)); } MappingProjectRepositoryImpl(
      DataService dataService,
      MappingTargetRepository mappingTargetRepo,
      IdGenerator idGenerator,
      MappingProjectMetadata mappingProjectMeta); }
MappingProjectRepositoryImpl implements MappingProjectRepository { @Override @Transactional public void add(MappingProject mappingProject) { if (mappingProject.getIdentifier() != null) { throw new MolgenisDataException("MappingProject already exists"); } dataService.add(MAPPING_PROJECT, toEntity(mappingProject)); } MappingProjectRepositoryImpl(
      DataService dataService,
      MappingTargetRepository mappingTargetRepo,
      IdGenerator idGenerator,
      MappingProjectMetadata mappingProjectMeta); @Override @Transactional void add(MappingProject mappingProject); @Override @Transactional void update(MappingProject mappingProject); @Override MappingProject getMappingProject(String identifier); @Override List<MappingProject> getAllMappingProjects(); @Override List<MappingProject> getMappingProjects(Query<Entity> q); @Override void delete(String mappingProjectId); }
MappingProjectRepositoryImpl implements MappingProjectRepository { @Override @Transactional public void add(MappingProject mappingProject) { if (mappingProject.getIdentifier() != null) { throw new MolgenisDataException("MappingProject already exists"); } dataService.add(MAPPING_PROJECT, toEntity(mappingProject)); } MappingProjectRepositoryImpl(
      DataService dataService,
      MappingTargetRepository mappingTargetRepo,
      IdGenerator idGenerator,
      MappingProjectMetadata mappingProjectMeta); @Override @Transactional void add(MappingProject mappingProject); @Override @Transactional void update(MappingProject mappingProject); @Override MappingProject getMappingProject(String identifier); @Override List<MappingProject> getAllMappingProjects(); @Override List<MappingProject> getMappingProjects(Query<Entity> q); @Override void delete(String mappingProjectId);  }