Examples of Searchable


Examples of com.sishuok.es.common.entity.search.Searchable

        SearchableDefaults searchDefaults = getSearchableDefaults(parameter);

        boolean needMergeDefault = searchDefaults != null && searchDefaults.merge();

        Searchable searchable = null;
        //自定义覆盖默认
        if (needMergeDefault || !hasCustomSearchFilter) {
            searchable = getDefaultFromAnnotation(searchDefaults);
        }
        if (hasCustomSearchFilter) {
            if (searchable == null) {
                searchable = Searchable.newSearchable();
            }
            for (String name : searcheableMap.keySet()) {
                String[] mapValues = filterSearchValues(searcheableMap.get(name));

                if (mapValues.length == 1) {
                    if (name.endsWith("in")) {
                        searchable.addSearchParam(name, StringUtils.split(mapValues[0], ",; "));
                    } else {
                        searchable.addSearchParam(name, mapValues[0]);
                    }
                } else {
                    searchable.addSearchParam(name, mapValues);
                }
            }
        }

        Pageable pageable = (Pageable) pageableMethodArgumentResolver.resolveArgument(parameter, mavContainer, webRequest, binderFactory);
        //默认分页及排序
        if (searchDefaults == null) {
            searchable.setPage(pageable);
        }
        //needPage=true 分页及排序
        if (searchDefaults != null && searchDefaults.needPage()) {
            searchable.setPage(pageable);
        }
        //needPage=false needSort=true  不要分页,但排序
        if (searchDefaults != null && !searchDefaults.needPage() && searchDefaults.needSort()) {
            searchable.addSort(pageable.getSort());
        }

        return searchable;
    }
View Full Code Here

Examples of com.sishuok.es.common.entity.search.Searchable

    }


    private Searchable getDefaultFromAnnotation(SearchableDefaults searchableDefaults) {

        Searchable searchable = defaultSearchable(searchableDefaults);
        if (searchable != null) {
            return searchable;
        }

        return Searchable.newSearchable();
View Full Code Here

Examples of com.sishuok.es.common.entity.search.Searchable

        if (searchableDefaults == null) {
            return null;
        }

        Searchable searchable = Searchable.newSearchable();
        for (String searchParam : searchableDefaults.value()) {
            String[] searchPair = searchParam.split("=");
            String paramName = searchPair[0];
            String paramValue = searchPair[1];
            if (paramName.endsWith("in")) {
                searchable.addSearchParam(paramName, StringUtils.split(paramValue, ",; "));
            } else {
                searchable.addSearchParam(paramName, paramValue);
            }
        }

        return searchable;
    }
View Full Code Here

Examples of com.sishuok.es.common.entity.search.Searchable

    @Override
    protected void setCommonData(Model model) {
        super.setCommonData(model);
        model.addAttribute("availableList", AvailableEnum.values());

        Searchable searchable = Searchable.newSearchable();
//        searchable.addSearchFilter("show", SearchOperator.eq, true);
        model.addAttribute("permissions", permissionService.findAllWithNoPageNoSort(searchable));
    }
View Full Code Here

Examples of com.sishuok.es.common.entity.search.Searchable

            user.getBaseInfo().setSex(Sex.male);
            userRepository.save(user);
        }
        Map<String, Object> searchParams = new HashMap<String, Object>();
        searchParams.put("baseInfo.sex_eq", "male");
        Searchable search = Searchable.newSearchable(searchParams);
        assertEquals(count, userRepository.count(search));
    }
View Full Code Here

Examples of com.sishuok.es.common.entity.search.Searchable

            user.getBaseInfo().setSex(Sex.male);
            userRepository.save(user);
        }
        Map<String, Object> searchParams = new HashMap<String, Object>();
        searchParams.put("baseInfo.sex_ne", "male");
        Searchable search = Searchable.newSearchable(searchParams);
        assertEquals(0, userRepository.count(search));
    }
View Full Code Here

Examples of com.sishuok.es.common.entity.search.Searchable

            userRepository.save(user);
        }
        Map<String, Object> searchParams = new HashMap<String, Object>();
        searchParams.put("baseInfo.birthday_gt", dateStrFrom);
        searchParams.put("baseInfo.birthday_lt", dateStrEnd);
        Searchable search = Searchable.newSearchable(searchParams);
        assertEquals(count, userRepository.count(search));
    }
View Full Code Here

Examples of com.sishuok.es.common.entity.search.Searchable

            userRepository.save(user);
        }
        Map<String, Object> searchParams = new HashMap<String, Object>();
        searchParams.put("baseInfo.birthday_gte", dateStrFrom);
        searchParams.put("baseInfo.birthday_lte", dateStrEnd);
        Searchable search = Searchable.newSearchable(searchParams);
        assertEquals(count, userRepository.count(search));
    }
View Full Code Here

Examples of net.sf.ehcache.config.Searchable

  }

  private CacheConfiguration tweakCacheConfiguration(CacheConfiguration cacheConfiguration) {

    // Set searchable index
    Searchable uidToDocumentCacheSearchable = new Searchable();
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("ObjectId")
                                                        .expression("value.getObjectId().toString()"));
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("VersionFromInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("VersionToInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("CorrectionFromInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("CorrectionToInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    cacheConfiguration.addSearchable(uidToDocumentCacheSearchable);

    // Make copies of cached objects
    CopyStrategyConfiguration copyStrategyConfiguration = new CopyStrategyConfiguration();
View Full Code Here

Examples of org.apache.isis.applib.annotation.Searchable

    public SearchableAnnotationFactory() {
        super(SearchableAnnotation.class);
    }

    public Annotation process(Class clazz) {
        Searchable annotation = (Searchable) clazz.getAnnotation(Searchable.class);
        return create(annotation);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.