Hi guys !
I'm my application, I'd like two compare two strings before insert an object in the database to test the unicity.
Here is a part of my code ! uery query = session .createQuery("select count(*) from ClientDTO client where client.nom=:nom"); query.setParameter("nom", client.getNom()); int count = ((Integer) query.uniqueResult()).intValue(); if (count != 0) {.....}
Is there a way to compare two varchar with ignoring the case ? Because if the parameter is "walmart" and if there is an entry in the database like "WALMART", the query won't have result.
Someone have a solution ?
Thank you in advance.
|