You cannot add restrictions to the Criteria property for this purpose, since during the selection, the specified property value must be executed in accordance with the type of the field specified in the Entity class.
However, the solution will use the SQLRestriction criteria by casting. I tested and it works.
yourDetachedCriteriaObj.add(Restrictions.sqlRestriction(" sequenceNo LIKE '%"+yourSequenceNumToSearch+"%' "));
To get a list, you would like to do below
List ls = yourDetachedCriteriaObj.getExecutableCriteria(yourSession).list();
source share