@javax.ws.rs.PUT
  @javax.ws.rs.Consumes(javax.ws.rs.core.MediaType.APPLICATION_JSON)
  public at.bestsolution.tasktracker.emapping.webservice.dto.DTOVersion create(
      at.bestsolution.tasktracker.emapping.webservice.dto.DTOVersion dto) {
    try (at.bestsolution.persistence.Session s = sessionFactory.createSession()) {
      at.bestsolution.tasktracker.model.tasktracker.Version entity =
          checkAccess_create(
              at.bestsolution.tasktracker.emapping.webservice.mapper.VersionDTOMapper.mergeToEntity(
                  at.bestsolution.tasktracker.emapping.webservice.mapper.VersionDTOMapper.create(),
                  dto),
              s);
      entity.setRepository(
          dto.getRepository() != null
              ? s.get(
                  at.bestsolution.tasktracker.model.tasktracker.TaskRepository.class,
                  dto.getRepository().getSid())
              : null);
      at.bestsolution.tasktracker.emapping.VersionMapper mapper =
          s.createMapper(at.bestsolution.tasktracker.emapping.VersionMapper.class);
      s.runInTransaction(
          se -> {
            mapper.insert(entity);
            return true;
          });

      return get(
          at.bestsolution.tasktracker.emapping.webservice.mapper.VersionDTOMapper.getId(entity));
    }
  }
 @javax.ws.rs.GET
 @javax.ws.rs.Path("{id}/repository")
 public at.bestsolution.tasktracker.emapping.webservice.dto.DTOTaskRepository getRepository(
     @javax.ws.rs.PathParam("id") long id) {
   try (at.bestsolution.persistence.Session s = sessionFactory.createSession()) {
     at.bestsolution.tasktracker.emapping.VersionMapper mapper =
         s.createMapper(at.bestsolution.tasktracker.emapping.VersionMapper.class);
     at.bestsolution.tasktracker.model.tasktracker.Version entity = mapper.selectById(id);
     if (entity == null) {
       throw new javax.ws.rs.WebApplicationException(
           "Entity 'Version' with ID '" + id + " is unknown.'",
           javax.ws.rs.core.Response.Status.NOT_FOUND);
     }
     return at.bestsolution.tasktracker.emapping.webservice.mapper.TaskRepositoryDTOMapper.toDTO(
         checkAccess_getRepository(entity, entity.getRepository(), s),
         at.bestsolution.tasktracker.emapping.webservice.mapper.TaskRepositoryDTOMapper
             ::fillAllProxyRefs);
   }
 }