@SuppressWarnings( "deprecation" )
@Test
public void shouldBeAbleToCreateAndExecuteSqlQueryWithContainsCriteria() throws RepositoryException {

    String sql = "SELECT * FROM nt:base WHERE jcr:path LIKE '/Cars/%' AND NOT jcr:path LIKE '/Cars/%/%'";
    Query query = session.getWorkspace().getQueryManager().createQuery(sql, Query.SQL);
    QueryResult result = query.execute();
    validateQuery().rowCount(4).hasColumns(allColumnNames()).validate(query, result);
}