Package org.springframework.data.jpa.domain

Examples of org.springframework.data.jpa.domain.Specifications


        final SchematronCriteriaRepository criteriaRepository = context.getBean(SchematronCriteriaRepository.class);
        final Element element;

        if (id == null) {
            Specifications spec = null;
            if (schematronId != null) {
                spec = Specifications.where(SchematronCriteriaSpecs.hasSchematronId(Integer.parseInt(schematronId)));
            }

            if (groupName != null) {
                final Specification<SchematronCriteria> hasGroupSpec = SchematronCriteriaSpecs.hasGroupName(groupName);
                if (spec == null) {
                    spec = Specifications.where(hasGroupSpec);
                } else {
                    spec = spec.and(hasGroupSpec);
                }
            }
            element = criteriaRepository.findAllAsXml(spec);
        } else {
            final SchematronCriteria criteria = criteriaRepository.findOne(Integer.parseInt(id));
View Full Code Here


                .editing)));
        if (allOpAlloweds.isEmpty()) {
            return false;
        }

        Specifications spec = where (UserGroupSpecs.hasProfile(Profile.Editor)).and(UserGroupSpecs.hasUserId(us.getUserIdAsInt()));

        List<Integer> opAlloweds = new ArrayList<Integer>();
        for (OperationAllowed opAllowed : allOpAlloweds) {
          opAlloweds.add(opAllowed.getId().getGroupId());
        }
        spec = spec.and(UserGroupSpecs.hasGroupIds(opAlloweds));
       
        return (! _userGroupRepository.findAll(spec).isEmpty());
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.jpa.domain.Specifications

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.