How do I do this query in HQL?
select * from entidadeQualquer where id::text like '%12';
I've tried the code below but it did not work:
select c from entidadeQualquerc where c.id like '%12';
How do I do this query in HQL?
select * from entidadeQualquer where id::text like '%12';
I've tried the code below but it did not work:
select c from entidadeQualquerc where c.id like '%12';
Without the entity code you can not be sure, but you can try something like this:
String hql = "select c from entidadeQualquer c where CAST(id as text) like :id";
And to set the parameter:
Query query = em.createQuery(hql);
query.setParameter("id", "%12");
List<EntidadeQualquer> lista = query.getResultList()