Examples of selectAuthor()


Examples of domain.blog.mappers.AuthorMapper.selectAuthor()

    manager.startManagedSession();
    AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
    Author expected = new Author(500, "cbegin", "******", "cbegin@somewhere.com", "Something...", null);
    mapper.insertAuthor(expected);
    manager.close();
    Author actual = mapper.selectAuthor(500);
    assertNull(actual);
  }

  @Test
  public void shouldDeleteAuthorUsingMapperClass() throws Exception {
View Full Code Here

Examples of domain.blog.mappers.AuthorMapper.selectAuthor()

  @Test
  public void shouldDeleteAuthorUsingMapperClass() throws Exception {
    AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
    int count = mapper.deleteAuthor(101);
    assertEquals(1, count);
    assertNull(mapper.selectAuthor(101));
  }

  @Test
  public void shouldUpdateAuthorUsingMapperClass() throws Exception {
    AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
View Full Code Here

Examples of domain.blog.mappers.AuthorMapper.selectAuthor()

  }

  @Test
  public void shouldUpdateAuthorUsingMapperClass() throws Exception {
    AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
    Author expected = mapper.selectAuthor(101);
    expected.setUsername("NewUsername");
    int count = mapper.updateAuthor(expected);
    assertEquals(1, count);
    Author actual = mapper.selectAuthor(101);
    assertEquals(expected.getUsername(), actual.getUsername());
View Full Code Here

Examples of domain.blog.mappers.AuthorMapper.selectAuthor()

    AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
    Author expected = mapper.selectAuthor(101);
    expected.setUsername("NewUsername");
    int count = mapper.updateAuthor(expected);
    assertEquals(1, count);
    Author actual = mapper.selectAuthor(101);
    assertEquals(expected.getUsername(), actual.getUsername());
  }

  @Test
  public void shouldSelectAllPostsUsingMapperClass() throws Exception {
View Full Code Here

Examples of domain.blog.mappers.AuthorMapperWithMultipleHandlers.selectAuthor()

    SqlSession sqlSession = sqlMapperWithMultipleHandlers.openSession();
    try {
      DefaultResultHandler handler1 = new DefaultResultHandler();
      DefaultResultHandler handler2 = new DefaultResultHandler();
      AuthorMapperWithMultipleHandlers mapper = sqlSession.getMapper(AuthorMapperWithMultipleHandlers.class);
      mapper.selectAuthor(101, handler1, handler2);
    } finally {
      sqlSession.close();
    }
  }
View Full Code Here

Examples of domain.blog.mappers.AuthorMapperWithRowBounds.selectAuthor()

    SqlSession sqlSession = sqlMapperWithMultipleHandlers.openSession();
    try {
      RowBounds bounds1 = new RowBounds(0, 1);
      RowBounds bounds2 = new RowBounds(0, 1);
      AuthorMapperWithRowBounds mapper = sqlSession.getMapper(AuthorMapperWithRowBounds.class);
      mapper.selectAuthor(101, bounds1, bounds2);
    } finally {
      sqlSession.close();
    }
  }
View Full Code Here

Examples of org.apache.ibatis.domain.blog.mappers.AuthorMapper.selectAuthor()

      manager.startManagedSession();
      AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
      Author expected = new Author(500, "cbegin", "******", "cbegin@somewhere.com", "Something...", null);
      mapper.insertAuthor(expected);
      manager.commit();
      Author actual = mapper.selectAuthor(500);
      assertNotNull(actual);
    } finally {
      manager.close();
    }
  }
View Full Code Here

Examples of org.apache.ibatis.domain.blog.mappers.AuthorMapper.selectAuthor()

      manager.startManagedSession();
      AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
      Author expected = new Author(501, "lmeadors", "******", "lmeadors@somewhere.com", "Something...", null);
      mapper.insertAuthor(expected);
      manager.rollback();
      Author actual = mapper.selectAuthor(501);
      assertNull(actual);
    } finally {
      manager.close();
    }
  }
View Full Code Here

Examples of org.apache.ibatis.domain.blog.mappers.AuthorMapper.selectAuthor()

    manager.startManagedSession();
    AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
    Author expected = new Author(502, "emacarron", "******", "emacarron@somewhere.com", "Something...", null);
    mapper.insertAuthor(expected);
    manager.close();
    Author actual = mapper.selectAuthor(502);
    assertNull(actual);
  }

}
View Full Code Here

Examples of org.apache.ibatis.domain.blog.mappers.AuthorMapper.selectAuthor()

  @Test
  public void shouldExecuteSelectOneAuthorUsingMapperClass() {
    SqlSession session = sqlMapper.openSession();
    try {
      AuthorMapper mapper = session.getMapper(AuthorMapper.class);
      Author author = mapper.selectAuthor(101);
      assertEquals(101, author.getId());
    } finally {
      session.close();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.