You must use ".as()" JPA function so the "cast" is called natively.
ie with your use case:
cb.like(from.get("uuid").as(String.class), String.format("%%%s%%", stringValue));