jpa criteria compare two strings in without considering spaces
问题 I think that it is a basic question, but I'm struggling to get an answer. The question is: using CriteriaBuilder and Predicate how can I compare strings without considering spaces in the middle. For example: "CH 525 kV AREIA 1077 PR" . There isn't a "replace" function in CriteriaBuilder library. cb.like(equipamento.get(EquipamentoBO_.txNomeLongo), "%" + dto.getTxNomeEquipamento().toUpperCase().replace(" ", "") + "%") Thanks 回答1: There is a function method which should do the trick for you if