org.jeecg.modules.demo.test.entity.JeecgDemo Java Examples
The following examples show how to use
org.jeecg.modules.demo.test.entity.JeecgDemo.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JeecgDemoServiceImpl.java From jeecg-cloud with Apache License 2.0 | 7 votes |
@Override public IPage<JeecgDemo> queryListWithPermission(int pageSize,int pageNo) { Page<JeecgDemo> page = new Page<>(pageNo, pageSize); //编程方式,获取当前请求的数据权限规则SQL片段 String sql = QueryGenerator.installAuthJdbc(JeecgDemo.class); return this.baseMapper.queryListWithPermission(page, sql); }
Example #2
Source File: JeecgDemoServiceImpl.java From jeecg-boot-with-activiti with MIT License | 6 votes |
/** * 事务控制在service层面 * 加上注解:@Transactional,声明的方法就是一个独立的事务(有异常DB操作全部回滚) */ @Override @Transactional public void testTran() { JeecgDemo pp = new JeecgDemo(); pp.setAge(1111); pp.setName("测试事务 小白兔 1"); jeecgDemoMapper.insert(pp); JeecgDemo pp2 = new JeecgDemo(); pp2.setAge(2222); pp2.setName("测试事务 小白兔 2"); jeecgDemoMapper.insert(pp2); Integer.parseInt("hello");//自定义异常 JeecgDemo pp3 = new JeecgDemo(); pp3.setAge(3333); pp3.setName("测试事务 小白兔 3"); jeecgDemoMapper.insert(pp3); return ; }
Example #3
Source File: JeecgDemoController.java From teaching with Apache License 2.0 | 6 votes |
/** * 分页列表查询 * * @param jeecgDemo * @param pageNo * @param pageSize * @param req * @return */ @ApiOperation(value = "获取Demo数据列表", notes = "获取所有Demo数据列表") @GetMapping(value = "/list") @PermissionData(pageComponent = "jeecg/JeecgDemoList") public Result<?> list(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { QueryWrapper<JeecgDemo> queryWrapper = QueryGenerator.initQueryWrapper(jeecgDemo, req.getParameterMap()); Page<JeecgDemo> page = new Page<JeecgDemo>(pageNo, pageSize); IPage<JeecgDemo> pageList = jeecgDemoService.page(page, queryWrapper); log.info("查询当前页:" + pageList.getCurrent()); log.info("查询当前页数量:" + pageList.getSize()); log.info("查询结果数量:" + pageList.getRecords().size()); log.info("数据总数:" + pageList.getTotal()); return Result.ok(pageList); }
Example #4
Source File: JeecgDemoController.java From jeecg-boot-with-activiti with MIT License | 6 votes |
/** * 分页列表查询 * * @param jeecgDemo * @param pageNo * @param pageSize * @param req * @return */ @ApiOperation(value = "获取Demo数据列表", notes = "获取所有Demo数据列表") @GetMapping(value = "/list") @PermissionData(pageComponent = "jeecg/JeecgDemoList") public Result<?> list(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { QueryWrapper<JeecgDemo> queryWrapper = QueryGenerator.initQueryWrapper(jeecgDemo, req.getParameterMap()); Page<JeecgDemo> page = new Page<JeecgDemo>(pageNo, pageSize); IPage<JeecgDemo> pageList = jeecgDemoService.page(page, queryWrapper); log.info("查询当前页:" + pageList.getCurrent()); log.info("查询当前页数量:" + pageList.getSize()); log.info("查询结果数量:" + pageList.getRecords().size()); log.info("数据总数:" + pageList.getTotal()); return Result.ok(pageList); }
Example #5
Source File: JeecgDemoServiceImpl.java From teaching with Apache License 2.0 | 6 votes |
/** * 事务控制在service层面 * 加上注解:@Transactional,声明的方法就是一个独立的事务(有异常DB操作全部回滚) */ @Override @Transactional public void testTran() { JeecgDemo pp = new JeecgDemo(); pp.setAge(1111); pp.setName("测试事务 小白兔 1"); jeecgDemoMapper.insert(pp); JeecgDemo pp2 = new JeecgDemo(); pp2.setAge(2222); pp2.setName("测试事务 小白兔 2"); jeecgDemoMapper.insert(pp2); Integer.parseInt("hello");//自定义异常 JeecgDemo pp3 = new JeecgDemo(); pp3.setAge(3333); pp3.setName("测试事务 小白兔 3"); jeecgDemoMapper.insert(pp3); return ; }
Example #6
Source File: JeecgDemoController.java From jeecg-boot with Apache License 2.0 | 6 votes |
/** * 分页列表查询 * * @param jeecgDemo * @param pageNo * @param pageSize * @param req * @return */ @ApiOperation(value = "获取Demo数据列表", notes = "获取所有Demo数据列表") @GetMapping(value = "/list") @PermissionData(pageComponent = "jeecg/JeecgDemoList") public Result<?> list(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { QueryWrapper<JeecgDemo> queryWrapper = QueryGenerator.initQueryWrapper(jeecgDemo, req.getParameterMap()); Page<JeecgDemo> page = new Page<JeecgDemo>(pageNo, pageSize); IPage<JeecgDemo> pageList = jeecgDemoService.page(page, queryWrapper); log.info("查询当前页:" + pageList.getCurrent()); log.info("查询当前页数量:" + pageList.getSize()); log.info("查询结果数量:" + pageList.getRecords().size()); log.info("数据总数:" + pageList.getTotal()); return Result.ok(pageList); }
Example #7
Source File: JeecgDemoServiceImpl.java From jeecg-cloud with Apache License 2.0 | 6 votes |
/** * 事务控制在service层面 * 加上注解:@Transactional,声明的方法就是一个独立的事务(有异常DB操作全部回滚) */ @Override @Transactional public void testTran() { JeecgDemo pp = new JeecgDemo(); pp.setAge(1111); pp.setName("测试事务 小白兔 1"); jeecgDemoMapper.insert(pp); JeecgDemo pp2 = new JeecgDemo(); pp2.setAge(2222); pp2.setName("测试事务 小白兔 2"); jeecgDemoMapper.insert(pp2); Integer.parseInt("hello");//自定义异常 JeecgDemo pp3 = new JeecgDemo(); pp3.setAge(3333); pp3.setName("测试事务 小白兔 3"); jeecgDemoMapper.insert(pp3); return ; }
Example #8
Source File: JeecgDemoController.java From jeecg-cloud with Apache License 2.0 | 6 votes |
/** * 分页列表查询 * * @param jeecgDemo * @param pageNo * @param pageSize * @param req * @return */ @ApiOperation(value = "获取Demo数据列表", notes = "获取所有Demo数据列表") @GetMapping(value = "/list") @PermissionData(pageComponent = "jeecg/JeecgDemoList") public Result<?> list(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { QueryWrapper<JeecgDemo> queryWrapper = QueryGenerator.initQueryWrapper(jeecgDemo, req.getParameterMap()); Page<JeecgDemo> page = new Page<JeecgDemo>(pageNo, pageSize); IPage<JeecgDemo> pageList = jeecgDemoService.page(page, queryWrapper); log.info("查询当前页:" + pageList.getCurrent()); log.info("查询当前页数量:" + pageList.getSize()); log.info("查询结果数量:" + pageList.getRecords().size()); log.info("数据总数:" + pageList.getTotal()); return Result.ok(pageList); }
Example #9
Source File: JeecgDemoServiceImpl.java From jeecg-boot with Apache License 2.0 | 6 votes |
/** * 事务控制在service层面 * 加上注解:@Transactional,声明的方法就是一个独立的事务(有异常DB操作全部回滚) */ @Override @Transactional public void testTran() { JeecgDemo pp = new JeecgDemo(); pp.setAge(1111); pp.setName("测试事务 小白兔 1"); jeecgDemoMapper.insert(pp); JeecgDemo pp2 = new JeecgDemo(); pp2.setAge(2222); pp2.setName("测试事务 小白兔 2"); jeecgDemoMapper.insert(pp2); Integer.parseInt("hello");//自定义异常 JeecgDemo pp3 = new JeecgDemo(); pp3.setAge(3333); pp3.setName("测试事务 小白兔 3"); jeecgDemoMapper.insert(pp3); return ; }
Example #10
Source File: SampleTest.java From teaching with Apache License 2.0 | 5 votes |
@Test public void testSelect() { System.out.println(("----- selectAll method test ------")); List<JeecgDemo> userList = jeecgDemoMapper.selectList(null); Assert.assertEquals(5, userList.size()); userList.forEach(System.out::println); }
Example #11
Source File: JeecgDemoController.java From teaching with Apache License 2.0 | 5 votes |
/** * 【数据权限示例 - 编程】mybatisPlus java类方式加载权限 * * @param pageNo * @param pageSize * @param req * @return */ @GetMapping(value = "/mpList") @PermissionData(pageComponent = "jeecg/JeecgDemoList") public Result<?> loadMpPermissonList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { QueryWrapper<JeecgDemo> queryWrapper = new QueryWrapper<JeecgDemo>(); //编程方式,给queryWrapper装载数据权限规则 QueryGenerator.installAuthMplus(queryWrapper, JeecgDemo.class); Page<JeecgDemo> page = new Page<JeecgDemo>(pageNo, pageSize); IPage<JeecgDemo> pageList = jeecgDemoService.page(page, queryWrapper); return Result.ok(pageList); }
Example #12
Source File: JeecgDemoController.java From jeecg-boot with Apache License 2.0 | 5 votes |
/** * 通过id查询 * * @param id * @return */ @GetMapping(value = "/queryById") @ApiOperation(value = "通过ID查询DEMO", notes = "通过ID查询DEMO") public Result<?> queryById(@ApiParam(name = "id", value = "示例id", required = true) @RequestParam(name = "id", required = true) String id) { JeecgDemo jeecgDemo = jeecgDemoService.getById(id); return Result.ok(jeecgDemo); }
Example #13
Source File: JeecgDemoController.java From jeecg-boot with Apache License 2.0 | 5 votes |
/** * 编辑 * * @param jeecgDemo * @return */ @PutMapping(value = "/edit") @ApiOperation(value = "编辑DEMO", notes = "编辑DEMO") @AutoLog(value = "编辑DEMO", operateType = CommonConstant.OPERATE_TYPE_3) public Result<?> edit(@RequestBody JeecgDemo jeecgDemo) { jeecgDemoService.updateById(jeecgDemo); return Result.ok("更新成功!"); }
Example #14
Source File: JeecgDemoController.java From jeecg-boot with Apache License 2.0 | 5 votes |
/** * 添加 * * @param jeecgDemo * @return */ @PostMapping(value = "/add") @AutoLog(value = "添加测试DEMO") @ApiOperation(value = "添加DEMO", notes = "添加DEMO") public Result<?> add(@RequestBody JeecgDemo jeecgDemo) { jeecgDemoService.save(jeecgDemo); return Result.ok("添加成功!"); }
Example #15
Source File: JeecgDemoController.java From jeecg-boot with Apache License 2.0 | 5 votes |
/** * redis操作 -- get */ @GetMapping(value = "/redis/{id}") public JeecgDemo redisGetJeecgDemo(@PathVariable("id") String id) { JeecgDemo t = jeecgDemoService.getByIdCacheable(id); log.info(t.toString()); return t; }
Example #16
Source File: JeecgDemoController.java From jeecg-boot with Apache License 2.0 | 5 votes |
/** * 【数据权限示例 - 编程】mybatisPlus java类方式加载权限 * * @param pageNo * @param pageSize * @param req * @return */ @GetMapping(value = "/mpList") @PermissionData(pageComponent = "jeecg/JeecgDemoList") public Result<?> loadMpPermissonList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { QueryWrapper<JeecgDemo> queryWrapper = new QueryWrapper<JeecgDemo>(); //编程方式,给queryWrapper装载数据权限规则 QueryGenerator.installAuthMplus(queryWrapper, JeecgDemo.class); Page<JeecgDemo> page = new Page<JeecgDemo>(pageNo, pageSize); IPage<JeecgDemo> pageList = jeecgDemoService.page(page, queryWrapper); return Result.ok(pageList); }
Example #17
Source File: JeecgDemoServiceImpl.java From teaching with Apache License 2.0 | 5 votes |
/** * 缓存注解测试: redis */ @Override @Cacheable(cacheNames = CacheConstant.TEST_DEMO_CACHE, key = "#id") public JeecgDemo getByIdCacheable(String id) { JeecgDemo t = jeecgDemoMapper.selectById(id); System.err.println("---未读缓存,读取数据库---"); System.err.println(t); return t; }
Example #18
Source File: JeecgDemoController.java From jeecg-boot with Apache License 2.0 | 5 votes |
/** * redis操作 -- setObj */ @GetMapping(value = "/redisSetObj") public void redisSetObj() { JeecgDemo p = new JeecgDemo(); p.setAge(10); p.setBirthday(new Date()); p.setContent("hello"); p.setName("张三"); p.setSex("男"); redisUtil.set("user-zdh", p); }
Example #19
Source File: JeecgDemoServiceImpl.java From jeecg-boot with Apache License 2.0 | 5 votes |
/** * 缓存注解测试: redis */ @Override @Cacheable(cacheNames = CacheConstant.TEST_DEMO_CACHE, key = "#id") public JeecgDemo getByIdCacheable(String id) { JeecgDemo t = jeecgDemoMapper.selectById(id); System.err.println("---未读缓存,读取数据库---"); System.err.println(t); return t; }
Example #20
Source File: JeecgDemoController.java From teaching with Apache License 2.0 | 5 votes |
/** * redis操作 -- get */ @GetMapping(value = "/redis/{id}") public JeecgDemo redisGetJeecgDemo(@PathVariable("id") String id) { JeecgDemo t = jeecgDemoService.getByIdCacheable(id); log.info(t.toString()); return t; }
Example #21
Source File: JeecgDemoController.java From teaching with Apache License 2.0 | 5 votes |
/** * redis操作 -- setObj */ @GetMapping(value = "/redisSetObj") public void redisSetObj() { JeecgDemo p = new JeecgDemo(); p.setAge(10); p.setBirthday(new Date()); p.setContent("hello"); p.setName("张三"); p.setSex("男"); redisUtil.set("user-zdh", p); }
Example #22
Source File: JeecgDemoController.java From teaching with Apache License 2.0 | 5 votes |
/** * 通过id查询 * * @param id * @return */ @GetMapping(value = "/queryById") @ApiOperation(value = "通过ID查询DEMO", notes = "通过ID查询DEMO") public Result<?> queryById(@ApiParam(name = "id", value = "示例id", required = true) @RequestParam(name = "id", required = true) String id) { JeecgDemo jeecgDemo = jeecgDemoService.getById(id); return Result.ok(jeecgDemo); }
Example #23
Source File: JeecgDemoController.java From teaching with Apache License 2.0 | 5 votes |
/** * 编辑 * * @param jeecgDemo * @return */ @PutMapping(value = "/edit") @ApiOperation(value = "编辑DEMO", notes = "编辑DEMO") @AutoLog(value = "编辑DEMO", operateType = CommonConstant.OPERATE_TYPE_3) public Result<?> edit(@RequestBody JeecgDemo jeecgDemo) { jeecgDemoService.updateById(jeecgDemo); return Result.ok("更新成功!"); }
Example #24
Source File: JeecgDemoController.java From teaching with Apache License 2.0 | 5 votes |
/** * 添加 * * @param jeecgDemo * @return */ @PostMapping(value = "/add") @AutoLog(value = "添加测试DEMO") @ApiOperation(value = "添加DEMO", notes = "添加DEMO") public Result<?> add(@RequestBody JeecgDemo jeecgDemo) { jeecgDemoService.save(jeecgDemo); return Result.ok("添加成功!"); }
Example #25
Source File: SampleTest.java From jeecg-boot with Apache License 2.0 | 5 votes |
@Test public void testSelect() { System.out.println(("----- selectAll method test ------")); List<JeecgDemo> userList = jeecgDemoMapper.selectList(null); Assert.assertEquals(5, userList.size()); userList.forEach(System.out::println); }
Example #26
Source File: SampleTest.java From jeecg-boot-with-activiti with MIT License | 5 votes |
@Test public void testSelect() { System.out.println(("----- selectAll method test ------")); List<JeecgDemo> userList = jeecgDemoMapper.selectList(null); Assert.assertEquals(5, userList.size()); userList.forEach(System.out::println); }
Example #27
Source File: JeecgDemoServiceImpl.java From jeecg-boot-with-activiti with MIT License | 5 votes |
@Override public IPage<JeecgDemo> queryListWithPermission(int pageSize,int pageNo) { Page<JeecgDemo> page = new Page<>(pageNo, pageSize); //编程方式,获取当前请求的数据权限规则SQL片段 String sql = QueryGenerator.installAuthJdbc(JeecgDemo.class); return this.baseMapper.queryListWithPermission(page, sql); }
Example #28
Source File: JeecgDemoServiceImpl.java From jeecg-boot-with-activiti with MIT License | 5 votes |
/** * 缓存注解测试: redis */ @Override @Cacheable(cacheNames = CacheConstant.TEST_DEMO_CACHE, key = "#id") public JeecgDemo getByIdCacheable(String id) { JeecgDemo t = jeecgDemoMapper.selectById(id); System.err.println("---未读缓存,读取数据库---"); System.err.println(t); return t; }
Example #29
Source File: JeecgDemoController.java From jeecg-cloud with Apache License 2.0 | 5 votes |
/** * 添加 * * @param jeecgDemo * @return */ @PostMapping(value = "/add") @AutoLog(value = "添加测试DEMO") @ApiOperation(value = "添加DEMO", notes = "添加DEMO") public Result<?> add(@RequestBody JeecgDemo jeecgDemo) { jeecgDemoService.save(jeecgDemo); return Result.ok("添加成功!"); }
Example #30
Source File: JeecgDemoServiceImpl.java From jeecg-boot with Apache License 2.0 | 5 votes |
@Override public IPage<JeecgDemo> queryListWithPermission(int pageSize,int pageNo) { Page<JeecgDemo> page = new Page<>(pageNo, pageSize); //编程方式,获取当前请求的数据权限规则SQL片段 String sql = QueryGenerator.installAuthJdbc(JeecgDemo.class); return this.baseMapper.queryListWithPermission(page, sql); }