src/main/java/de/otto/teamdojo/service/DimensionQueryService.java
private Specification<Dimension> createSpecification(DimensionCriteria criteria) {
        Specification<Dimension> specification = Specification.where(null);
        if (criteria != null) {
            if (criteria.getId() != null) {
                specification = specification.and(buildSpecification(criteria.getId(), Dimension_.id));
            }
            if (criteria.getName() != null) {
                specification = specification.and(buildStringSpecification(criteria.getName(), Dimension_.name));
            }
            if (criteria.getDescription() != null) {
                specification = specification.and(buildStringSpecification(criteria.getDescription(), Dimension_.description));
            }
            if (criteria.getParticipantsId() != null) {
                specification = specification.and(buildReferringEntitySpecification(criteria.getParticipantsId(), Dimension_.participants, Team_.id));
            }
            if (criteria.getLevelsId() != null) {
                specification = specification.and(buildReferringEntitySpecification(criteria.getLevelsId(), Dimension_.levels, Level_.id));
            }
            if (criteria.getBadgesId() != null) {
                specification = specification.and(buildReferringEntitySpecification(criteria.getBadgesId(), Dimension_.badges, Badge_.id));
            }
        }
        return specification;
    }
/**
     * Function to convert DimensionCriteria to a {@link Specification}
     */
Function to convert DimensionCriteria to a  Specification
Function to convert DimensionCriteria to a Specification
private Specification<Dimension> createSpecification(DimensionCriteria criteria) {
        Specification<Dimension> specification = Specification.where(null);
        if (criteria != null) {
            if (criteria.getId() != null) {
                specification = specification.and(buildSpecification(criteria.getId(), Dimension_.id));
            }
            if (criteria.getName() != null) {
                specification = specification.and(buildStringSpecification(criteria.getName(), Dimension_.name));
            }
            if (criteria.getDescription() != null) {
                specification = specification.and(buildStringSpecification(criteria.getDescription(), Dimension_.description));
            }
            if (criteria.getParticipantsId() != null) {
                specification = specification.and(buildReferringEntitySpecification(criteria.getParticipantsId(), Dimension_.participants, Team_.id));
            }
            if (criteria.getLevelsId() != null) {
                specification = specification.and(buildReferringEntitySpecification(criteria.getLevelsId(), Dimension_.levels, Level_.id));
            }
            if (criteria.getBadgesId() != null) {
                specification = specification.and(buildReferringEntitySpecification(criteria.getBadgesId(), Dimension_.badges, Badge_.id));
            }
        }
        return specification;
    }
private Specification < Dimension > createSpecification ( DimensionCriteria criteria ) { Specification < Dimension > specification = Specification . where ( null ) ; if ( criteria != null ) { if ( criteria . getId ( ) != null ) { specification = specification . and ( buildSpecification ( criteria . getId ( ) , Dimension_ . id ) ) ; } if ( criteria . getName ( ) != null ) { specification = specification . and ( buildStringSpecification ( criteria . getName ( ) , Dimension_ . name ) ) ; } if ( criteria . getDescription ( ) != null ) { specification = specification . and ( buildStringSpecification ( criteria . getDescription ( ) , Dimension_ . description ) ) ; } if ( criteria . getParticipantsId ( ) != null ) { specification = specification . and ( buildReferringEntitySpecification ( criteria . getParticipantsId ( ) , Dimension_ . participants , Team_ . id ) ) ; } if ( criteria . getLevelsId ( ) != null ) { specification = specification . and ( buildReferringEntitySpecification ( criteria . getLevelsId ( ) , Dimension_ . levels , Level_ . id ) ) ; } if ( criteria . getBadgesId ( ) != null ) { specification = specification . and ( buildReferringEntitySpecification ( criteria . getBadgesId ( ) , Dimension_ . badges , Badge_ . id ) ) ; } } return specification ; }
Function to convert DimensionCriteria to a {@link Specification}
Function to convert DimensionCriteria to a { @link Specification }