Package org.sonar.core.persistence

Examples of org.sonar.core.persistence.DbSession


  }

  @Test
  public void select_comments_by_issues_empty_input() {
    // no need to connect to db
    DbSession session = mock(DbSession.class);
    List<DefaultIssueComment> comments = dao.selectCommentsByIssues(session, Collections.<String>emptyList());

    assertThat(comments).isEmpty();
  }
View Full Code Here


    this.builders = builders;
  }

  @Override
  public void persist() {
    DbSession session = myBatis.openSession(true);
    GraphDtoMapper mapper = session.getMapper(GraphDtoMapper.class);
    try {
      for (ComponentVertex component : projectGraph.getComponents()) {
        persistComponentGraph(mapper, component);
      }
      session.commit();
    } finally {
      session.close();
    }
  }
View Full Code Here

    return session.getMapper(PermissionTemplateMapper.class).selectByKey(templateKey);
  }

  @CheckForNull
  public PermissionTemplateDto selectTemplateByKey(String templateKey) {
    DbSession session = myBatis.openSession(false);
    try {
      return selectTemplateByKey(session, templateKey);
    } finally {
      MyBatis.closeQuietly(session);
    }
View Full Code Here

    return permissionTemplate;
  }

  @CheckForNull
  public PermissionTemplateDto selectPermissionTemplate(String templateKey) {
    DbSession session = myBatis.openSession(false);
    try {
      return selectPermissionTemplate(session, templateKey);
    } finally {
      MyBatis.closeQuietly(session);
    }
View Full Code Here

  public List<PermissionTemplateDto> selectAllPermissionTemplates(DbSession session) {
    return session.selectList("selectAllPermissionTemplates");
  }

  public List<PermissionTemplateDto> selectAllPermissionTemplates() {
    DbSession session = myBatis.openSession(false);
    try {
      return selectAllPermissionTemplates(session);
    } finally {
      MyBatis.closeQuietly(session);
    }
View Full Code Here

  public NotificationQueueDao(MyBatis mybatis) {
    this.mybatis = mybatis;
  }

  public void insert(List<NotificationQueueDto> dtos) {
    DbSession session = mybatis.openSession(true);
    try {
      for (NotificationQueueDto dto : dtos) {
        session.getMapper(NotificationQueueMapper.class).insert(dto);
      }
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

      MyBatis.closeQuietly(session);
    }
  }

  public void delete(List<NotificationQueueDto> dtos) {
    DbSession session = mybatis.openSession(true);
    try {
      for (NotificationQueueDto dto : dtos) {
        session.getMapper(NotificationQueueMapper.class).delete(dto.getId());
      }
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

   *
   * @return the user, null if user not found
   */
  @CheckForNull
  public UserDto selectActiveUserByLogin(String login) {
    DbSession session = mybatis.openSession(false);
    try {
      return selectActiveUserByLogin(login, session);
    } finally {
      MyBatis.closeQuietly(session);
    }
View Full Code Here

    return mapper.selectGroupByName(name);
  }

  @CheckForNull
  public GroupDto selectGroupByName(String name) {
    DbSession session = mybatis.openSession(false);
    try {
      return selectGroupByName(name, session);
    } finally {
      MyBatis.closeQuietly(session);
    }
View Full Code Here

  public void insert(ActiveRuleDto dto, SqlSession session) {
    session.getMapper(ActiveRuleMapper.class).insert(dto);
  }

  public List<ActiveRuleDto> selectByProfileKey(String profileKey) {
    DbSession session = mybatis.openSession(false);
    try {
      return session.getMapper(ActiveRuleMapper.class).selectByProfileKey(profileKey);
    } finally {
      session.close();
    }
  }
View Full Code Here

TOP

Related Classes of org.sonar.core.persistence.DbSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.