Examples of EntityInfo


Examples of org.hibernate.search.query.engine.spi.EntityInfo

     * Extract an entityInfo, either from cache or from the index.
     * @param x the position in the index.
     * @return
     */
    private EntityInfo getEntityInfo(int x) {
      EntityInfo entityInfo = einfo==null ? null : einfo.get();
      if ( entityInfo==null ) {
        try {
          entityInfo = documentExtractor.extract( x );
        }
        catch (IOException e) {
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.EntityInfo

  public EntityInfo extract(int scoreDocIndex) throws IOException {
    int docId = queryHits.docId( scoreDocIndex );
    Document document = extractDocument( scoreDocIndex );

    EntityInfo entityInfo = extractEntityInfo( docId, document, scoreDocIndex );
    Object[] eip = entityInfo.getProjection();

    if ( eip != null && eip.length > 0 ) {
      for ( int x = 0; x < projection.length; x++ ) {
        if ( ProjectionConstants.SCORE.equals( projection[x] ) ) {
          eip[x] = queryHits.score( scoreDocIndex );
        }
        else if ( ProjectionConstants.ID.equals( projection[x] ) ) {
          eip[x] = entityInfo.getId();
        }
        else if ( ProjectionConstants.DOCUMENT.equals( projection[x] ) ) {
          eip[x] = document;
        }
        else if ( ProjectionConstants.DOCUMENT_ID.equals( projection[x] ) ) {
          eip[x] = docId;
        }
        else if ( ProjectionConstants.BOOST.equals( projection[x] ) ) {
          eip[x] = FLOAT_ONE;
        }
        else if ( ProjectionConstants.EXPLANATION.equals( projection[x] ) ) {
          eip[x] = queryHits.explain( scoreDocIndex );
        }
        else if ( ProjectionConstants.OBJECT_CLASS.equals( projection[x] ) ) {
          eip[x] = entityInfo.getClazz();
        }
        else if ( ProjectionConstants.THIS.equals( projection[x] ) ) {
          //THIS could be projected more than once
          //THIS loading delayed to the Loader phase
          entityInfo.getIndexesOfThis().add( x );
        }
      }
    }
    return entityInfo;
  }
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.EntityInfo

            .targetedEntities(Collections.<Class<?>>singletonList(ProtobufValueWrapper.class))
            .projection("surname")
            .queryEntityInfos();

      assertEquals(1, queryEntityInfos.size());
      EntityInfo entityInfo = queryEntityInfos.get(0);
      assertEquals("Nistor", entityInfo.getProjection()[0]);
   }
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.EntityInfo

     * or reload them and update the cache entry.
     * @param x absolute position in fulltext result.
     * @return the managed objects
     */
    private Object[] getManagedResult(int x) {
      EntityInfo entityInfo = getEntityInfo( x );
      Object[] objects = entity == null ? null : entity.get();
      if ( objects != null && areAllEntitiesManaged( objects, entityInfo ) ) {
        return objects;
      }
      else {
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.EntityInfo

     * Extract an entityInfo, either from cache or from the index.
     * @param x the position in the index.
     * @return
     */
    private EntityInfo getEntityInfo(int x) {
      EntityInfo entityInfo = einfo == null ? null : einfo.get();
      if ( entityInfo == null ) {
        try {
          entityInfo = documentExtractor.extract( x );
        }
        catch (IOException e) {
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.EntityInfo

  @Override
  public EntityInfo extract(int scoreDocIndex) throws IOException {
    int docId = queryHits.docId( scoreDocIndex );
    Document document = extractDocument( scoreDocIndex );

    EntityInfo entityInfo = extractEntityInfo( docId, document, scoreDocIndex, exceptionWrap );
    Object[] eip = entityInfo.getProjection();

    if ( eip != null && eip.length > 0 ) {
      for ( int x = 0; x < projection.length; x++ ) {
        if ( ProjectionConstants.SCORE.equals( projection[x] ) ) {
          eip[x] = queryHits.score( scoreDocIndex );
        }
        else if ( ProjectionConstants.ID.equals( projection[x] ) ) {
          eip[x] = entityInfo.getId();
        }
        else if ( ProjectionConstants.DOCUMENT.equals( projection[x] ) ) {
          eip[x] = document;
        }
        else if ( ProjectionConstants.DOCUMENT_ID.equals( projection[x] ) ) {
          eip[x] = docId;
        }
        else if ( ProjectionConstants.EXPLANATION.equals( projection[x] ) ) {
          eip[x] = queryHits.explain( scoreDocIndex );
        }
        else if ( ProjectionConstants.OBJECT_CLASS.equals( projection[x] ) ) {
          eip[x] = entityInfo.getClazz();
        }
        else if ( ProjectionConstants.SPATIAL_DISTANCE.equals( projection[x] ) ) {
          eip[x] = queryHits.spatialDistance( scoreDocIndex );
        }
        else if ( ProjectionConstants.THIS.equals( projection[x] ) ) {
          //THIS could be projected more than once
          //THIS loading delayed to the Loader phase
          entityInfo.getIndexesOfThis().add( x );
        }
      }
    }
    return entityInfo;
  }
View Full Code Here

Examples of org.keycloak.connections.mongo.impl.EntityInfo

        BasicDBObject dbObject = context.getObjectToConvert();
        if (dbObject == null) {
            return null;
        }

        EntityInfo entityInfo = mongoStoreImpl.getEntityInfo(expectedEntityType);

        S entity;
        try {
            entity = expectedEntityType.newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        for (String key : dbObject.keySet()) {
            Object value = dbObject.get(key);
            Property<Object> property;

            if ("_id".equals(key)) {
                // Current property is "id"
                if (entity instanceof MongoIdentifiableEntity) {
                    ((MongoIdentifiableEntity)entity).setId(value.toString());
                }

            } else if ((property = entityInfo.getPropertyByName(key)) != null) {
                // It's declared property with @DBField annotation
                setPropertyValue(entity, value, property);

            } else {
                // Show warning if it's unknown
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.EntityInfo

          boolean versionExplicit = uri.indexOf("version=") >= 0;
          dispatchOntologyPanel(registeredOntologyInfo, versionExplicit);
          return;
        }
       
        EntityInfo entityInfo = resolveUriResult.getEntityInfo();
        if ( entityInfo != null ) {
          dispatchEntityPanel(entityInfo);
          return;
        }
       
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.EntityInfo

    }
   
    boolean ok = false;
   
    if ( ! result.toLowerCase().startsWith("error:") ) {
      EntityInfo entityInfo = new EntityInfo();
     
      String[] lines = result.split("\n|\r\n|\n");
      for (String string : lines) {
        String[] toks = string.split(",", 2);
        if ( toks.length != 2 || ("prop".equals(toks[0]) && "value".equals(toks[1])) ) {
          continue;
        }
        String prop = toks[0];
        String value = toks.length > 1 ? toks[1] : null;
       
        Resource propResource = ResourceFactory.createResource(prop);
       
        PropValue pv = new PropValue();
        pv.setPropName(propResource.getLocalName());
        pv.setPropUri(prop);
       
        boolean valueIsUri = false;
        try {
          URI jUri = new URI(value)// just check to see whether is a URI
          valueIsUri = jUri.isAbsolute();
        }
        catch (URISyntaxException e) {
          // ignore.
        }
        if ( valueIsUri ) {
          pv.setValueUri(value);
          Resource objResource = ResourceFactory.createResource(value);
          pv.setValueName(objResource.getLocalName());
        }
        else {
          pv.setValueName(value);
        }
       
        entityInfo.getProps().add(pv);
      }
     
      int size = entityInfo.getProps().size();
      if ( size > 0 ) {
        ok = true;
        entityInfo.setUri(uri);
        if ( log.isDebugEnabled() ) {
          log.debug("Added " +size+ " property/value pairs to " +uri);
        }
        resolveUriResult.setEntityInfo(entityInfo);
      }
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.EntityInfo

      String entityUri = ind.getURI();
      if ( entityUri == null ) {
        continue;
      }
     
      EntityInfo entityInfo = new EntityInfo();
      entityInfo.setUri(entityUri);

      String localName = _getLocalName(entityUri, ontologyUri);
      entityInfo.setLocalName(localName);

      _addProps(entityUri, entityInfo, ontModel, dtProps);
      entities.add(entityInfo);
    }
   
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.