Code example for EmptyInterceptor

0
import org.hibernate.EmptyInterceptor;
 
/** 
 * @author Matthieu Chaffotte 
 */ 
public class PostgresInterceptor extends EmptyInterceptor {
 
    private static final long serialVersionUID = -6720122264417020259L;
 
    @Override 
    public String onPrepareStatement(final String sql) {
        return sql.replaceAll("like '", "ilike '").replaceAll("LIKE '", "ilike '");
    } 
 
}