javax.jcr.query.Query.getBindVariableNames()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(192)

本文整理了Java中javax.jcr.query.Query.getBindVariableNames方法的一些代码示例,展示了Query.getBindVariableNames的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getBindVariableNames方法的具体详情如下:
包路径:javax.jcr.query.Query
类名称:Query
方法名:getBindVariableNames

Query.getBindVariableNames介绍

[英]Returns the names of the bind variables in this query. If this query does not contains any bind variables then an empty array is returned.
[中]返回此查询中绑定变量的名称。如果此查询不包含任何绑定变量,则返回空数组。

代码示例

代码示例来源:origin: net.adamcin.oakpal/oakpal-core

@Override
  public String[] getBindVariableNames() throws RepositoryException {
    return delegate.getBindVariableNames();
  }
}

代码示例来源:origin: apache/jackrabbit

/** {@inheritDoc} */
public String[] getBindVariableNames() 
    throws RepositoryException, RemoteException {
  try {
    return query.getBindVariableNames();
  } catch (RepositoryException ex) {
    throw getRepositoryException(ex);
  }
}

代码示例来源:origin: brix-cms/brix-cms

public String[] execute() throws Exception {
    return getDelegate().getBindVariableNames();
  }
});

代码示例来源:origin: brix-cms/brix-cms

public String[] getBindVariableNames() throws RepositoryException {
    return getDelegate().getBindVariableNames();
  }
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-spi2jcr

/**
 * {@inheritDoc}
 */
public String[] checkQueryStatement(SessionInfo sessionInfo,
                String statement,
                String language,
                Map<String, String> namespaces)
    throws InvalidQueryException, RepositoryException {
  Query q = createQuery(getSessionInfoImpl(sessionInfo).getSession(),
      statement, language, namespaces);
  return q.getBindVariableNames();
}

代码示例来源:origin: apache/jackrabbit

public void testBindVariableNames() throws RepositoryException {
  String[] names = qomQuery.getBindVariableNames();
  assertNotNull(names);
  assertEquals(1, names.length);
  assertEquals("v", names[0]);
}

代码示例来源:origin: apache/jackrabbit

/**
 * {@inheritDoc}
 */
public String[] checkQueryStatement(SessionInfo sessionInfo,
                String statement,
                String language,
                Map<String, String> namespaces)
    throws InvalidQueryException, RepositoryException {
  Query q = createQuery(getSessionInfoImpl(sessionInfo).getSession(),
      statement, language, namespaces);
  return q.getBindVariableNames();
}

代码示例来源:origin: apache/jackrabbit-oak

public void testQuery4() throws Exception {
  String statement = 
      "/jcr:root/myRep:security/myRep:authorizables//" + 
      "element(*,myRep:Authorizable)[@my:property='value']";
  QueryManager qm = session.getWorkspace().getQueryManager();
  Query q = qm.createQuery(statement, "xpath");
  
  q.getBindVariableNames();
  QueryResult qr = q.execute();
  NodeIterator ni = qr.getNodes();
  while (ni.hasNext()) {
    ni.next();
  }
  
}

代码示例来源:origin: apache/jackrabbit

public void testFulltextBindVariableSQL() throws Exception {
  Node foo = testRootNode.addNode("foo");
  foo.setProperty("mytext", new String[]{"the quick brown fox jumps over the lazy dog."});
  
  testRootNode.save();
  
  String sql = "SELECT * FROM [nt:unstructured]"
    + " WHERE ISCHILDNODE([" + testRoot + "])"
    + " AND CONTAINS(mytext, $searchExpression)";
  Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.JCR_SQL2);
  assertEquals("Expected exactly 1 bind variable", 1, q.getBindVariableNames().length);
  assertEquals("searchExpression", q.getBindVariableNames()[0]);
  q.bindValue("searchExpression", superuser.getValueFactory().createValue("fox"));
  QueryResult result = q.execute();
  checkResult(result, 1);
}

相关文章