Example #1
0
 public void delete() throws Exception {
   UserRoleEntity entity = new UserRoleEntity();
   entity.setUserRoleId(Integer.valueOf(6));
   this.service.delete(entity);
   entity = this.service.queryForObject(entity);
   if (entity != null) System.out.println("ɾ����ѯ��" + entity.toString());
   else System.out.println("ɾ����ѯ�� ������");
 }
Example #2
0
 @Test
 public void queryForList() throws Exception {
   UserRoleEntity entity = new UserRoleEntity();
   entity.setRoleId(Integer.valueOf(2));
   List<UserRoleEntity> list = this.service.queryForList(entity);
   for (UserRoleEntity entity1 : list) System.out.println("���º��ѯ��" + entity1.toString());
   System.out.println("--" + list.size());
 }
Example #3
0
 public void update() throws Exception {
   UserRoleEntity entity = new UserRoleEntity();
   entity.setUserRoleId(Integer.valueOf(5));
   entity.setUserId(Integer.valueOf(2));
   this.service.update(entity);
   entity = this.service.queryForObject(entity);
   System.out.println("���º��ѯ��" + entity.toString());
 }
Example #4
0
 public void queryForPage() throws Exception {
   Integer pageSize = Integer.valueOf(10);
   Integer pageNum = Integer.valueOf(1);
   Integer userId = null;
   Integer roleId = Integer.valueOf(1);
   Integer userRoleId = null;
   Map<String, Object> map = new HashMap<String, Object>();
   map.put("userId", userId);
   map.put("roleId", roleId);
   map.put("userRoleId", userRoleId);
   map.put("startIndex", Integer.valueOf(pageSize.intValue() * (pageNum.intValue() - 1)));
   map.put("pageSize", pageSize);
   List<UserRoleEntity> list = this.service.queryForPage(map);
   Long count = this.service.count(map);
   for (UserRoleEntity entity : list) System.out.println("���º��ѯ��" + entity.toString());
   System.out.println(count + "--" + list.size());
 }