protected Iterator<Node> _getReferents(Node referenced, String propertyName) throws RepositoryException {
String path = referenced.getPath();
QueryManager queryMgr = session.getWorkspace().getQueryManager();
Query query = queryMgr.createQuery("SELECT * FROM nt:base WHERE " + propertyName + "='" + path + "'", Query.SQL);
QueryResult result = query.execute();
@SuppressWarnings("unchecked") Iterator<Node> nodes = result.getNodes();
return new AbstractFilterIterator<Node, Node>(nodes) {
private Node current;
protected Node adapt(Node node) {
current = node;
return node;