public void shouldBeAbleToCreateAndExecuteJcrSql2QueryWithMultipleReferenceConstraintUsingJoin() throws RepositoryException {
String sql = "SELECT typed.* FROM [notion:typed] AS typed JOIN [mix:referenceable] AS target ON typed.[notion:multipleReferences] = target.[jcr:uuid] WHERE PATH(target) = '/Other/NodeA[2]'";
Query query = session.getWorkspace().getQueryManager().createQuery(sql, Query.JCR_SQL2);
assertThat(query, is(notNullValue()));
QueryResult result = query.execute();
validateQuery().rowCount(1).hasColumns(typedColumnNames("typed")).onEachRow(new Predicate() {
@Override
public void validate( int rowNumber,
Row row ) throws RepositoryException {
assertValueIsNonNullReference(row, "typed.notion:singleReference");
assertValueIsNonNullReference(row, "typed.notion:multipleReferences");