src/main/java/de/otto/teamdojo/service/CommentQueryService.java
private Specification<Comment> createSpecification(CommentCriteria criteria) {
        Specification<Comment> specification = Specification.where(null);
        if (criteria != null) {
            if (criteria.getId() != null) {
                specification = specification.and(buildSpecification(criteria.getId(), Comment_.id));
            }
            if (criteria.getText() != null) {
                specification = specification.and(buildStringSpecification(criteria.getText(), Comment_.text));
            }
            if (criteria.getCreationDate() != null) {
                specification = specification.and(buildRangeSpecification(criteria.getCreationDate(), Comment_.creationDate));
            }
            if (criteria.getTeamId() != null) {
                specification = specification.and(buildReferringEntitySpecification(criteria.getTeamId(), Comment_.team, Team_.id));
            }
            if (criteria.getSkillId() != null) {
                specification = specification.and(buildReferringEntitySpecification(criteria.getSkillId(), Comment_.skill, Skill_.id));
            }
        }
        return specification;
    }
/**
     * Function to convert CommentCriteria to a {@link Specification}
     */
Function to convert CommentCriteria to a  Specification
Function to convert CommentCriteria to a Specification
private Specification<Comment> createSpecification(CommentCriteria criteria) {
        Specification<Comment> specification = Specification.where(null);
        if (criteria != null) {
            if (criteria.getId() != null) {
                specification = specification.and(buildSpecification(criteria.getId(), Comment_.id));
            }
            if (criteria.getText() != null) {
                specification = specification.and(buildStringSpecification(criteria.getText(), Comment_.text));
            }
            if (criteria.getCreationDate() != null) {
                specification = specification.and(buildRangeSpecification(criteria.getCreationDate(), Comment_.creationDate));
            }
            if (criteria.getTeamId() != null) {
                specification = specification.and(buildReferringEntitySpecification(criteria.getTeamId(), Comment_.team, Team_.id));
            }
            if (criteria.getSkillId() != null) {
                specification = specification.and(buildReferringEntitySpecification(criteria.getSkillId(), Comment_.skill, Skill_.id));
            }
        }
        return specification;
    }
private Specification < Comment > createSpecification ( CommentCriteria criteria ) { Specification < Comment > specification = Specification . where ( null ) ; if ( criteria != null ) { if ( criteria . getId ( ) != null ) { specification = specification . and ( buildSpecification ( criteria . getId ( ) , Comment_ . id ) ) ; } if ( criteria . getText ( ) != null ) { specification = specification . and ( buildStringSpecification ( criteria . getText ( ) , Comment_ . text ) ) ; } if ( criteria . getCreationDate ( ) != null ) { specification = specification . and ( buildRangeSpecification ( criteria . getCreationDate ( ) , Comment_ . creationDate ) ) ; } if ( criteria . getTeamId ( ) != null ) { specification = specification . and ( buildReferringEntitySpecification ( criteria . getTeamId ( ) , Comment_ . team , Team_ . id ) ) ; } if ( criteria . getSkillId ( ) != null ) { specification = specification . and ( buildReferringEntitySpecification ( criteria . getSkillId ( ) , Comment_ . skill , Skill_ . id ) ) ; } } return specification ; }
Function to convert CommentCriteria to a {@link Specification}
Function to convert CommentCriteria to a { @link Specification }