Package com.ketayao.ketacustom.util.persistence

Examples of com.ketayao.ketacustom.util.persistence.SearchFilter


  @RequiresPermissions("Organization:view")
  @RequestMapping(value="/list/{parentOrganizationId}", method={RequestMethod.GET, RequestMethod.POST})
  public String list(ServletRequest request, Page page, @PathVariable Long parentOrganizationId,
      Map<String, Object> map) {
    Specification<Organization> specification = DynamicSpecifications.bySearchFilter(request, Organization.class,
        new SearchFilter("parent.id", Operator.EQ, parentOrganizationId));
    List<Organization> organizations = organizationService.findByExample(specification, page);
   
    map.put("page", page);
    map.put("organizations", organizations);
    map.put("parentOrganizationId", parentOrganizationId);
View Full Code Here


  @RequestMapping(value="/list", method={RequestMethod.GET, RequestMethod.POST})
  public String list(Long id, ServletRequest request, Page page, Map<String, Object> map) {
    Specification<Dictionary> specification = null;
    if (id != null) {
      specification = DynamicSpecifications.bySearchFilter(request, Dictionary.class,
          new SearchFilter("parent.id", Operator.EQ, id));
     
      map.put("dictionaryType", DictionaryType.ITEM.name());
      map.put("pDictionary", dictionaryService.get(id));
    } else {
      specification = DynamicSpecifications.bySearchFilter(request, Dictionary.class,
          new SearchFilter("type", Operator.EQ, DictionaryType.THEME.name()));
      map.put("dictionaryType", DictionaryType.THEME.name());
    }
    List<Dictionary> dictionarys = dictionaryService.findByExample(specification, page);
   
    map.put("page", page);
View Full Code Here

 
  @RequiresPermissions("Module:view")
  @RequestMapping(value="/list/{parentModuleId}", method={RequestMethod.GET, RequestMethod.POST})
  public String list(ServletRequest request, Page page, @PathVariable Long parentModuleId, Map<String, Object> map) {
    Specification<Module> specification = DynamicSpecifications.bySearchFilter(request, Module.class,
        new SearchFilter("parent.id", Operator.EQ, parentModuleId));
    List<Module> modules = moduleService.findByExample(specification, page);
   
    map.put("page", page);
    map.put("modules", modules);
    map.put("parentModuleId", parentModuleId);
View Full Code Here

   
    String[] ids = null;
    if (method.getName().endsWith(MANY_METHOD_SUFFIX)) { // 多对象操作方法
      ids = request.getParameterValues(MANY_KEY);
      if (ids != null) {
        filterSet.add(new SearchFilter("id", Operator.IN, ids));
      }
    } else {
      String id = request.getParameter("id");
      if (id != null) {
        filterSet.add(new SearchFilter("id", Operator.EQ, id));
      } else {
        // 截取类似/update/{id}的id
        String uri = request.getRequestURI();
        String tmp = StringUtils.substringAfterLast(uri, "/");
        Long longId = NumberUtils.toLong(tmp);
        if (longId != 0L) {
          filterSet.add(new SearchFilter("id", Operator.EQ, longId));
        }
      }
    }
   
    Object clazz = Class.forName(module.getClassName()).newInstance();
View Full Code Here

TOP

Related Classes of com.ketayao.ketacustom.util.persistence.SearchFilter

Copyright © 2018 www.massapicom. 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.