compare

jpa criteria compare two strings in without considering spaces

僤鯓⒐⒋嵵緔 提交于 2020-12-12 11:34:24
问题 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

jpa criteria compare two strings in without considering spaces

落花浮王杯 提交于 2020-12-12 11:31:22
问题 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

How to check if content of webpage has been changed?

假如想象 提交于 2020-11-26 06:48:09
问题 Basically I'm trying to run some code (Python 2.7) if the content on a website changes, otherwise wait for a bit and check it later. I'm thinking of comparing hashes , the problem with this is that if the page has changed a single byte or character, the hash would be different. So for example if the page display the current date on the page, every single time the hash would be different and tell me that the content has been updated. So... How would you do this? Would you look at the Kb size