Package org.hibernate.hql.ast.spi

Examples of org.hibernate.hql.ast.spi.EntityNamesResolver


    return query;
  }

  private MongoDBProcessingChain createProcessingChain(Session session, Map<String, Object> namedParameters) {
    EntityNamesResolver entityNamesResolver = getDefinedEntityNames( session.getSessionFactory() );

    return new MongoDBProcessingChain(
        (SessionFactoryImplementor) session.getSessionFactory(),
        entityNamesResolver,
        namedParameters );
View Full Code Here


*/
public class ReflectionParsingTest extends AbstractParsingTest {

   @Override
   protected FilterProcessingChain<Class<?>> createFilterProcessingChain() throws Exception {
      EntityNamesResolver entityNamesResolver = new ReflectionEntityNamesResolver(null);
      ReflectionPropertyHelper reflectionPropertyHelper = new ReflectionPropertyHelper(entityNamesResolver);
      return FilterProcessingChain.build(entityNamesResolver, reflectionPropertyHelper, null);
   }
View Full Code Here

   @Override
   protected FilterProcessingChain<Descriptor> createFilterProcessingChain() throws IOException, DescriptorParserException {
      SerializationContext serCtx = ProtobufUtil.newSerializationContext(new ConfigurationBuilder().build());
      MarshallerRegistration.registerMarshallers(serCtx);
      EntityNamesResolver entityNamesResolver = new ProtobufEntityNamesResolver(serCtx);
      ProtobufPropertyHelper protobufPropertyHelper = new ProtobufPropertyHelper(entityNamesResolver, serCtx);
      return FilterProcessingChain.build(entityNamesResolver, protobufPropertyHelper, null);
   }
View Full Code Here

  private boolean hasProjections(Neo4jQueryParsingResult result) {
    return result.getProjections() != null && !result.getProjections().isEmpty();
  }

  private Neo4jProcessingChain createProcessingChain(Session session, Map<String, Object> namedParameters) {
    EntityNamesResolver entityNamesResolver = getDefinedEntityNames( session.getSessionFactory() );
    return new Neo4jProcessingChain( (SessionFactoryImplementor) session.getSessionFactory(), entityNamesResolver, namedParameters );
  }
View Full Code Here

      QueryParser queryParser = new QueryParser();
      SearchFactoryIntegrator searchFactory = (SearchFactoryIntegrator) searchManager.getSearchFactory();
      if (cache.getCacheConfiguration().compatibility().enabled()) {
         final QueryInterceptor queryInterceptor = ComponentRegistryUtils.getQueryInterceptor(cache);
         EntityNamesResolver entityNamesResolver = new EntityNamesResolver() {
            @Override
            public Class<?> getClassFromName(String entityName) {
               MessageMarshaller messageMarshaller = (MessageMarshaller) serCtx.getMarshaller(entityName);
               Class clazz = messageMarshaller.getJavaClass();
               return queryInterceptor.isIndexed(clazz) ? clazz : null;
            }
         };

         LuceneProcessingChain processingChain = new LuceneProcessingChain.Builder(searchFactory, entityNamesResolver)
               .buildProcessingChainForClassBasedEntities();

         LuceneQueryParsingResult parsingResult = queryParser.parseQuery(request.getJpqlString(), processingChain);

         MessageMarshaller messageMarshaller = (MessageMarshaller) serCtx.getMarshaller(parsingResult.getTargetEntity());
         messageDescriptor = serCtx.getMessageDescriptor(messageMarshaller.getTypeName());
         targetEntity = parsingResult.getTargetEntity();
         projections = parsingResult.getProjections();
         luceneQuery = parsingResult.getQuery();
      } else {
         EntityNamesResolver entityNamesResolver = new EntityNamesResolver() {
            @Override
            public Class<?> getClassFromName(String entityName) {
               return serCtx.canMarshall(entityName) ? ProtobufValueWrapper.class : null;
            }
         };
View Full Code Here

      QueryParser queryParser = new QueryParser();
      SearchFactoryIntegrator searchFactory = (SearchFactoryIntegrator) searchManager.getSearchFactory();
      if (cache.getCacheConfiguration().compatibility().enabled()) {
         final QueryInterceptor queryInterceptor = ComponentRegistryUtils.getQueryInterceptor(cache);
         EntityNamesResolver entityNamesResolver = new EntityNamesResolver() {
            @Override
            public Class<?> getClassFromName(String entityName) {
               MessageMarshaller messageMarshaller = (MessageMarshaller) serCtx.getMarshaller(entityName);
               Class clazz = messageMarshaller.getJavaClass();
               return queryInterceptor.isIndexed(clazz) ? clazz : null;
            }
         };

         LuceneProcessingChain processingChain = new LuceneProcessingChain.Builder(searchFactory, entityNamesResolver)
               .buildProcessingChainForClassBasedEntities();

         parsingResult = queryParser.parseQuery(request.getJpqlString(), processingChain);
         cacheQuery = searchManager.getQuery(parsingResult.getQuery(), parsingResult.getTargetEntity());
      } else {
         EntityNamesResolver entityNamesResolver = new EntityNamesResolver() {
            @Override
            public Class<?> getClassFromName(String entityName) {
               return serCtx.canMarshall(entityName) ? ProtobufValueWrapper.class : null;
            }
         };
View Full Code Here

      this.queryCache = ComponentRegistryUtils.getQueryCache(cache);
   }

   @Override
   public QueryFactory<LuceneQuery> getQueryFactory() {
      EntityNamesResolver entityNamesResolver = new EntityNamesResolver() {
         @Override
         public Class<?> getClassFromName(String entityName) {
            Class clazz;
            try {
               clazz = Util.loadClassStrict(entityName, null);
View Full Code Here

      return true;
    }
  }

  private LuceneProcessingChain createProcessingChain(Session session, Map<String, Object> namedParameters, FullTextSession fullTextSession) {
    EntityNamesResolver entityNamesResolver = getDefinedEntityNames( session.getSessionFactory() );
    SearchFactoryImplementor searchFactory = (SearchFactoryImplementor) fullTextSession.getSearchFactory();

    return new LuceneProcessingChain.Builder( searchFactory, entityNamesResolver )
        .namedParameters( namedParameters )
        .buildProcessingChainForClassBasedEntities();
View Full Code Here

    return new MongoDBQueryImpl( result.getEntityType(), result.getQuery(), result.getProjection(), session );
  }

  private MongoDBProcessingChain createProcessingChain(Session session, Map<String, Object> namedParameters) {
    EntityNamesResolver entityNamesResolver = getDefinedEntityNames( session.getSessionFactory() );

    return new MongoDBProcessingChain(
        (SessionFactoryImplementor) session.getSessionFactory(),
        entityNamesResolver,
        namedParameters );
View Full Code Here

      return true;
    }
  }

  private LuceneProcessingChain createProcessingChain(Session session, Map<String, Object> namedParameters, FullTextSession fullTextSession) {
    EntityNamesResolver entityNamesResolver = getDefinedEntityNames( session.getSessionFactory() );
    SearchFactoryImplementor searchFactory = (SearchFactoryImplementor) fullTextSession.getSearchFactory();

    return new LuceneProcessingChain.Builder( searchFactory, entityNamesResolver )
        .namedParameters( namedParameters )
        .buildProcessingChainForClassBasedEntities();
View Full Code Here

TOP

Related Classes of org.hibernate.hql.ast.spi.EntityNamesResolver

Copyright © 2018 www.massapicom. 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.