Package com.gemstone.gemfire.cache.query

Examples of com.gemstone.gemfire.cache.query.Query.execute()


  @SuppressWarnings("unchecked")
  public <E> SelectResults<E> find(final String queryString, final Object... params) throws InvalidDataAccessApiUsageException {
    try {
      QueryService queryService = lookupQueryService(getRegion());
      Query query = queryService.newQuery(queryString);
      Object result = query.execute(params);

      if (result instanceof SelectResults) {
        return (SelectResults<E>) result;
      }
      else {
View Full Code Here


  @SuppressWarnings("unchecked")
  public <T> T findUnique(final String queryString, final Object... params) throws InvalidDataAccessApiUsageException {
    try {
      QueryService queryService = lookupQueryService(getRegion());
      Query query = queryService.newQuery(queryString);
      Object result = query.execute(params);

      if (result instanceof SelectResults) {
        SelectResults<T> selectResults = (SelectResults<T>) result;

        if (selectResults.asList().size() == 1) {
View Full Code Here

  @SuppressWarnings("rawtypes")
  public void setUp() throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException {
    QueryService queryService = MockRegionFactory.mockQueryService();
    Query singleQuery = mock(Query.class);

    when(singleQuery.execute(any(Object[].class))).thenReturn(0);
    when(queryService.newQuery(SINGLE_QUERY)).thenReturn(singleQuery);

    Query multipleQuery = mock(Query.class);
    SelectResults selectResults = mock(SelectResults.class);
View Full Code Here

    when(queryService.newQuery(SINGLE_QUERY)).thenReturn(singleQuery);

    Query multipleQuery = mock(Query.class);
    SelectResults selectResults = mock(SelectResults.class);

    when(multipleQuery.execute(any(Object[].class))).thenReturn(selectResults);
    when(queryService.newQuery(MULTI_QUERY)).thenReturn(multipleQuery);
  }

  @After
  public void tearDown() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.