Examples of Results


Examples of jp.freeex.us.fourtypes.shared.Results

    long elapse = System.currentTimeMillis();
    log.info("[StatisticsManager#clearResults()] start");
    // キャッシュ上のすべての結果をリストへ移動
    Cache cache =
        CacheManager.getInstance().getCache(C_NAME);
    cache.put(C_KEY_RESULTS, new Results());
    log.info("[StatisticsManager#clearResults()] end: " +
        (System.currentTimeMillis() - elapse) + "mSec.");
  }
View Full Code Here

Examples of net.sf.ehcache.search.Results

  public D get(ObjectIdentifiable objectId, VersionCorrection versionCorrection) {
    ArgumentChecker.notNull(objectId, "objectId");
    ArgumentChecker.notNull(versionCorrection, "versionCorrection");

    // Search through attributes for specified oid, versions/corrections
    Results results = getUidToDocumentCache().createQuery()
        .includeKeys().includeValues()
        .includeAttribute(getUidToDocumentCache().getSearchAttribute("ObjectId"))
        .includeAttribute(getUidToDocumentCache().getSearchAttribute("VersionFromInstant"))
        .includeAttribute(getUidToDocumentCache().getSearchAttribute("VersionToInstant"))
        .includeAttribute(getUidToDocumentCache().getSearchAttribute("CorrectionFromInstant"))
        .includeAttribute(getUidToDocumentCache().getSearchAttribute("CorrectionToInstant"))
        .addCriteria(getUidToDocumentCache().getSearchAttribute("ObjectId").eq(objectId.toString()))
        .addCriteria(getUidToDocumentCache().getSearchAttribute("VersionFromInstant")
            .le(versionCorrection.withLatestFixed(InstantExtractor.MAX_INSTANT).getVersionAsOf().toString()))
        .addCriteria(getUidToDocumentCache().getSearchAttribute("VersionToInstant")
            .gt(versionCorrection.withLatestFixed(InstantExtractor.MAX_INSTANT.minusNanos(1)).getVersionAsOf().toString()))
        .addCriteria(getUidToDocumentCache().getSearchAttribute("CorrectionFromInstant")
            .le(versionCorrection.withLatestFixed(InstantExtractor.MAX_INSTANT).getCorrectedTo().toString()))
        .addCriteria(getUidToDocumentCache().getSearchAttribute("CorrectionToInstant")
            .gt(versionCorrection.withLatestFixed(InstantExtractor.MAX_INSTANT.minusNanos(1)).getCorrectedTo().toString()))
        .execute();

    // Found a matching cached document
    if (results.size() == 1 && results.all().get(0).getValue() != null) {
      @SuppressWarnings("unchecked")
      D result = (D) results.all().get(0).getValue();

      // Debug: check result against underlying
      if (TEST_AGAINST_UNDERLYING) {
        D check = getUnderlying().get(objectId, versionCorrection);
        if (!result.equals(check)) {
          s_logger.error(getUidToDocumentCache().getName() + " returned:\n" + result + "\nbut the underlying master returned:\n" + check);
        }
      }

      // Return cached value
      return result;

    // No cached document found, fetch from underlying by oid/vc instead
    // Note: no self-populating by oid/vc, and no caching of misses by oid/vc
    } else if (results.size() == 0) {
      // Get from underlying by oid/vc, throwing exception if not there
      D result = _underlying.get(objectId, versionCorrection);

      // Explicitly insert in cache
      getUidToDocumentCache().put(new Element(result.getUniqueId(), result));
View Full Code Here

Examples of net.unto.twitter.TwitterProtos.Results


  @Test
  public void testNewResults() throws IOException {
    String json = readTestData("search.json");
    Results results = JsonUtil.newResults(json);
    assertEquals(new Integer(15), new Integer(results.getResultsList().size()));
  }
View Full Code Here

Examples of org.apache.accumulo.examples.wikisearch.sample.Results

    }
   
    StringWriter xml = new StringWriter();
    StringWriter html = new StringWriter();
   
    Results results = query(query, auths);
    try {
      // Marshall the query results object
      JAXBContext ctx = JAXBContext.newInstance(Results.class);
      Marshaller m = ctx.createMarshaller();
      m.marshal(results, xml);
View Full Code Here

Examples of org.apache.ibatis.annotations.Results

  private void parseResultsAndConstructorArgs(Method method) {
    Class<?> returnType = getReturnType(method);
    if (returnType != null) {
      ConstructorArgs args = method.getAnnotation(ConstructorArgs.class);
      Results results = method.getAnnotation(Results.class);
      TypeDiscriminator typeDiscriminator = method.getAnnotation(TypeDiscriminator.class);
      String resultMapId = generateResultMapName(method);
      applyResultMap(resultMapId, returnType, argsIf(args), resultsIf(results), typeDiscriminator);
    }
  }
View Full Code Here

Examples of org.apache.isis.objectstore.sql.Results

            sql.append(" from ");
            sql.append(table);
            sql.append(" where ");
            idMapping.appendUpdateValues(connector, sql, parentAdapter);
           
            final Results rs = connector.select(sql.toString());
            final List<ObjectAdapter> list = new ArrayList<ObjectAdapter>();
            while (rs.next()) {
                final Oid oid = idMapping.recreateOid(rs, specification);
                final ObjectAdapter element = getAdapter(specification, oid);
                loadFields(element, rs);
                if(LOG.isDebugEnabled()) {
                    LOG.debug("  element  " + element.getOid());
                }
                list.add(element);
            }
            final CollectionFacet collectionFacet = collectionAdapter.getSpecification().getFacet(CollectionFacet.class);
            collectionFacet.init(collectionAdapter, list.toArray(new ObjectAdapter[list.size()]));
            rs.close();
        } finally {
            PersistorUtil.toEndState(collectionAdapter);
        }

    }
View Full Code Here

Examples of org.apache.isis.objectstore.sql.Results

            sql.append(", ");
            elementMapping.appendColumnNames(sql);
            sql.append(" from ");
            sql.append(tableName);

            final Results rs = connector.select(sql.toString());
            final List<ObjectAdapter> list = new ArrayList<ObjectAdapter>();
            while (rs.next()) {
                final ObjectAdapter element = ((JdbcObjectReferenceMapping) elementMapping).initializeField(rs);
                if (LOG.isDebugEnabled()) {
                    LOG.debug("  element  " + element.getOid());
                }
                list.add(element);
            }
            final CollectionFacet collectionFacet =
                collectionAdapter.getSpecification().getFacet(CollectionFacet.class);
            collectionFacet.init(collectionAdapter, list.toArray(new ObjectAdapter[list.size()]));
            rs.close();
        } finally {
            PersistorUtil.toEndState(collectionAdapter);
        }
    }
View Full Code Here

Examples of org.apache.isis.objectstore.sql.Results

    @Override
    public ObjectAdapter getObject(final DatabaseConnector connector, final TypedOid typedOid) {
        final StringBuffer sql = createSelectStatement();
        sql.append(" WHERE ");
        idMapping.appendWhereClause(connector, sql, (RootOid) typedOid);
        final Results rs = connector.select(completeSelectStatement(sql, 0, 0));
        final ObjectSpecification objectSpec = getSpecificationLoader().lookupBySpecId(typedOid.getObjectSpecId());
        if (rs.next()) {
            return loadMappedObject(connector, objectSpec, rs);
        } else {
            throw new ObjectNotFoundException("No object with with " + typedOid + " in table " + table);
        }
    }
View Full Code Here

Examples of org.apache.isis.objectstore.sql.Results

    private void loadInstancesToVector(final DatabaseConnector connector, final ObjectSpecification cls, final String selectStatment, final Vector<ObjectAdapter> instances) {
        LOG.debug("loading instances from SQL " + table);

        try {
            final Results rs = connector.select(selectStatment);
            final int maxInstances = Defaults.getMaxInstances();
            for (int count = 0; rs.next() && count < maxInstances; count++) {
                final ObjectAdapter instance = loadMappedObject(connector, cls, rs);
                LOG.debug("  instance  " + instance);
                instances.addElement(instance);
            }
            rs.close();
        } catch (final SqlObjectStoreException e) {
            // Invalid SELECT means no object found.. don't worry about it,
            // here.
        }
    }
View Full Code Here

Examples of org.apache.isis.objectstore.sql.Results

        sql.append(versionMapping.appendColumnNames());
        sql.append(" from " + table + " WHERE ");
        final RootOid oid = (RootOid) object.getOid();
        idMapping.appendWhereClause(connector, sql, oid);

        final Results rs = connector.select(sql.toString());
        if (rs.next()) {
            loadFields(object, rs);
            rs.close();

            for (final CollectionMapper collectionMapper : collectionMappers) {
                collectionMapper.loadInternalCollection(connector, object);
            }
        } else {
            rs.close();
            throw new SqlObjectStoreException("Unable to load data from " + table + " with id " + object.getOid().enString(getOidMarshaller()));
        }
    }
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.