String hash = HashUtil.hash(hanaDok.getFileName());
Query query = entityManager.createQuery("SELECT o FROM OracleDok o WHERE o.fileNameHash = :hash", OracleDok.class);
query.setParameter("hash", hash);
This avoids encryption issues and is efficient for lookups.