use of org.apache.ibatis.domain.blog.Author in project mybatis-3 by mybatis.
the class SqlSessionTest method shouldExecuteSelectOneAuthorUsingMapperClass.
@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();
}
}
use of org.apache.ibatis.domain.blog.Author in project mybatis-3 by mybatis.
the class SqlSessionTest method shouldExecuteSelectOneAuthorUsingMapperClassWithResultHandler.
@Test
public void shouldExecuteSelectOneAuthorUsingMapperClassWithResultHandler() {
SqlSession session = sqlMapper.openSession();
try {
DefaultResultHandler handler = new DefaultResultHandler();
AuthorMapper mapper = session.getMapper(AuthorMapper.class);
mapper.selectAuthor(101, handler);
Author author = (Author) handler.getResultList().get(0);
assertEquals(101, author.getId());
} finally {
session.close();
}
}
use of org.apache.ibatis.domain.blog.Author in project mybatis-3 by mybatis.
the class SqlSessionTest method shouldExecuteSelectAllAuthorsUsingMapperClassThatReturnsLinkedList.
@Test
public void shouldExecuteSelectAllAuthorsUsingMapperClassThatReturnsLinkedList() {
SqlSession session = sqlMapper.openSession();
try {
AuthorMapper mapper = session.getMapper(AuthorMapper.class);
Collection<Author> authors = mapper.selectAllAuthorsLinkedList();
assertEquals(2, authors.size());
} finally {
session.close();
}
}
use of org.apache.ibatis.domain.blog.Author in project mybatis-3 by mybatis.
the class SqlSessionTest method shouldExecuteSelectAllAuthorsUsingMapperClassThatReturnsAnArray.
@Test
public void shouldExecuteSelectAllAuthorsUsingMapperClassThatReturnsAnArray() {
SqlSession session = sqlMapper.openSession();
try {
AuthorMapper mapper = session.getMapper(AuthorMapper.class);
Author[] authors = mapper.selectAllAuthorsArray();
assertEquals(2, authors.length);
} finally {
session.close();
}
}
use of org.apache.ibatis.domain.blog.Author in project mybatis-3 by mybatis.
the class SqlSessionTest method shouldExecuteSelectAllAuthorsUsingMapperClassThatReturnsSet.
@Test
public void shouldExecuteSelectAllAuthorsUsingMapperClassThatReturnsSet() {
SqlSession session = sqlMapper.openSession();
try {
AuthorMapper mapper = session.getMapper(AuthorMapper.class);
Collection<Author> authors = mapper.selectAllAuthorsSet();
assertEquals(2, authors.size());
} finally {
session.close();
}
}
Aggregations