I'm facing a non usual issue while using criterias. I want to do a criteria with a like clause but the text contains special chars like the bracket char "[" and it seems that it's a special char in MSSQL database.
From an sql query I must use the special wording ESCAPE see example :
AND file1.FILE_NAME like '%[Main profile picture]%' **ESCAPE '['**
But I dont know how I can do the same using criteria. I'm currently using this clause temporarily :
criteria.add(Restrictions.like("files.fileName", "%Main profile picture%"));
but that's not what I want I really need to escape the '['
char.
Can somebody help me with this please...?
Thank you for your help!