Source:
<code>public List<Workflow> findByPaths(List<String> paths, boolean findPublished) { List<Predicate> predicates = new ArrayList<>(); SourceControlConverter converter = new SourceControlConverter(); Predicate predicate; CriteriaBuilder cb = currentSession().getCriteriaBuilder(); CriteriaQuery<Workflow> q = cb.createQuery(Workflow.class); Root<Workflow> entry = q.from(Workflow.class); for (String path : paths) { String[] splitPath = Workflow.splitPath(path); if (splitPath == null) { continue; } String sourcecontrol = splitPath[registryIndex]; String organization = splitPath[orgIndex]; String repository = splitPath[repoIndex]; String workflowname = splitPath[entryNameIndex]; if (splitPath[entryNameIndex] == null) { if (findPublished) { predicate = cb.and( cb.isNull(entry.get("workflowName")), cb.isTrue(entry.get("isPublished")) ); } else { predicate = cb.isNull(entry.get("workflowName")); } } else { if (findPublished) { predicate = cb.and( cb.equal(entry.get("workflowName"), workflowname), cb.isTrue(entry.get("isPublished")) ); } else { predicate = cb.equal(entry.get("workflowName"), workflowname); } } predicates.add(cb.and( <START> cb.equal(entry.get("sourceControl"), converter.convertToEntityAttribute(sourcecontrol)), <END> cb.equal(entry.get("organization"), organization), cb.equal(entry.get("repository"), repository), predicate) ); } q.where(cb.or(predicates.toArray(new Predicate[]{}))); EntityManager entityManager = currentSession().getEntityManagerFactory().createEntityManager(); return entityManager.createQuery(q).getResultList(); }</code><technical_language>sourceControl is spelled a capital C; in findByPath is spelled a case C. While Postgres is generally case-insensitive, I think, explicitly create a case-sensitive column name, same. constants for hard-coded strings in shared findByPath</technical_language>

Target:
public List<Workflow> findByPaths(List<String> paths, boolean findPublished) { List<Predicate> predicates = new ArrayList<>(); SourceControlConverter converter = new SourceControlConverter(); CriteriaBuilder cb = currentSession().getCriteriaBuilder(); CriteriaQuery<Workflow> q = cb.createQuery(Workflow.class); Root<Workflow> entry = q.from(Workflow.class); for (String path : paths) { String[] splitPath = Workflow.splitPath(path); if (splitPath == null) { continue; } String sourcecontrol = splitPath[registryIndex]; String organization = splitPath[orgIndex]; String repository = splitPath[repoIndex]; String workflowname = splitPath[entryNameIndex]; Predicate predicate; if (splitPath[entryNameIndex] == null) { if (findPublished) { predicate = cb.and( cb.isNull(entry.get(WORKFLOW_NAME)), cb.isTrue(entry.get(IS_PUBLISHED)) ); } else { predicate = cb.isNull(entry.get(WORKFLOW_NAME)); } } else { if (findPublished) { predicate = cb.and( cb.equal(entry.get(WORKFLOW_NAME), workflowname), cb.isTrue(entry.get(IS_PUBLISHED)) ); } else { predicate = cb.equal(entry.get(WORKFLOW_NAME), workflowname); } } predicates.add(cb.and( cb.equal(entry.get("sourceControl"), converter.convertToEntityAttribute(sourcecontrol)), cb.equal(entry.get("organization"), organization), cb.equal(entry.get("repository"), repository), predicate) ); } q.where(cb.or(predicates.toArray(new Predicate[]{}))); EntityManager entityManager = currentSession().getEntityManagerFactory().createEntityManager(); return entityManager.createQuery(q).getResultList(); }