如何将PageHelper测试改写为长尾关键词?
- 内容介绍
- 文章标签
- 相关推荐
本文共计180个文字,预计阅读时间需要1分钟。
测试pagehelper
javaimport java.util.List;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;import com.github.pagehelper.PageHelper;import com.github.pagehelper.PageInfo;
测试pagehelper1import java.util.List;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import cn.e3mall.mapper.TbItemMapper;
import cn.e3mall.pojo.TbItem;
import cn.e3mall.pojo.TbItemExample;
public class PageHelperTest {
public void testPageHelper() {
// 初始化spring容器
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
"classpath:spring/applicationContext-dao.xml");
// 从容器中获得Mapper代理对象
TbItemMapper itemMapper = applicationContext.getBean(TbItemMapper.class);
// 执行sql语句之前设置分页信息使用PageHelper的startPage方法。
PageHelper.startPage(1, 10);
// 执行查询
TbItemExample example = new TbItemExample();
List
本文共计180个文字,预计阅读时间需要1分钟。
测试pagehelper
javaimport java.util.List;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;import com.github.pagehelper.PageHelper;import com.github.pagehelper.PageInfo;
测试pagehelper1import java.util.List;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import cn.e3mall.mapper.TbItemMapper;
import cn.e3mall.pojo.TbItem;
import cn.e3mall.pojo.TbItemExample;
public class PageHelperTest {
public void testPageHelper() {
// 初始化spring容器
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
"classpath:spring/applicationContext-dao.xml");
// 从容器中获得Mapper代理对象
TbItemMapper itemMapper = applicationContext.getBean(TbItemMapper.class);
// 执行sql语句之前设置分页信息使用PageHelper的startPage方法。
PageHelper.startPage(1, 10);
// 执行查询
TbItemExample example = new TbItemExample();
List

