Package org.hibernate.hql.ast.spi

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


* @since 7.0
*/
public final class CompatibilityReflectionMatcher extends ReflectionMatcher {

   public CompatibilityReflectionMatcher(final SerializationContext serializationContext) {
      super(new EntityNamesResolver() {
         @Override
         public Class<?> getClassFromName(String entityName) {
            try {
               MessageMarshaller messageMarshaller = (MessageMarshaller) serializationContext.getMarshaller(entityName);
               return messageMarshaller.getJavaClass();
View Full Code Here


   private LuceneQueryParsingResult parseQuery(AdvancedCache<byte[], byte[]> cache, final SerializationContext serCtx, String queryString, SearchFactoryIntegrator searchFactory) {
      LuceneProcessingChain processingChain;
      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;
            }
         };

         processingChain = new LuceneProcessingChain.Builder(searchFactory, entityNamesResolver)
               .buildProcessingChainForClassBasedEntities();
      } else {
         EntityNamesResolver entityNamesResolver = new EntityNamesResolver() {
            @Override
            public Class<?> getClassFromName(String entityName) {
               return serCtx.canMarshall(entityName) ? ProtobufValueWrapper.class : 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

      this.queryInterceptor = ComponentRegistryUtils.getQueryInterceptor(cache);
   }

   @Override
   public QueryFactory<LuceneQuery> getQueryFactory() {
      EntityNamesResolver entityNamesResolver = new EntityNamesResolver() {
         @Override
         public Class<?> getClassFromName(String entityName) {
            Class clazz;
            try {
               clazz = Class.forName(entityName)//todo [anistor] any potential class loading issues in AS ?
View Full Code Here

  public boolean supportsParameters() {
    return true;
  }

  private Neo4jProcessingChain createProcessingChain(SessionFactoryImplementor sessionFactory) {
    EntityNamesResolver entityNamesResolver = getDefinedEntityNames( sessionFactory );
    return new Neo4jProcessingChain( sessionFactory, entityNamesResolver, Collections.<String, Object>emptyMap() );
  }
View Full Code Here

  @Before
  public void setupQueryBuilder() {
    SearchFactoryIntegrator searchFactory = factoryHolder.getSearchFactory();
    QueryContextBuilder queryContextBuilder = searchFactory.buildQueryBuilder();
    EntityNamesResolver nameResolver = MapBasedEntityNamesResolver.forClasses( IndexedEntity.class );
    PropertyHelper propertyHelper = new ClassBasedLucenePropertyHelper( searchFactory, nameResolver );

    queryBuilder = SingleEntityQueryBuilder.getInstance(
        new LucenePredicateFactory( queryContextBuilder, nameResolver ),
        propertyHelper
View Full Code Here

  private ClassBasedLucenePropertyHelper propertyHelper;

  @Before
  public void setupPropertyTypeHelper() {
    EntityNamesResolver nameResolver = MapBasedEntityNamesResolver.forClasses( IndexedEntity.class );
    propertyHelper = new ClassBasedLucenePropertyHelper( factoryHolder.getSearchFactory(), nameResolver );
  }
View Full Code Here

  public SearchFactoryHolder factoryHolder = new SearchFactoryHolder( IndexedEntity.class );

  @Override
  protected LuceneProcessingChain setUpLuceneProcessingChain(Map<String, Object> namedParameters) {
    SearchFactoryIntegrator searchFactory = factoryHolder.getSearchFactory();
    EntityNamesResolver nameResolver = MapBasedEntityNamesResolver.forClasses( IndexedEntity.class );

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

  public SearchFactoryHolder factoryHolder = new SearchFactoryHolder( GenericValueHolder.class );

  @Override
  protected LuceneProcessingChain setUpLuceneProcessingChain(Map<String, Object> namedParameters) {
    SearchFactoryIntegrator searchFactory = factoryHolder.getSearchFactory();
    EntityNamesResolver nameResolver = new ConstantEntityNamesResolver();

    return new LuceneProcessingChain.Builder( searchFactory, nameResolver )
      .namedParameters( namedParameters )
      .buildProcessingChainForDynamicEntities( new TestFieldBridgeProvider() );
  }
View Full Code Here

      this.queryInterceptor = ComponentRegistryUtils.getQueryInterceptor(cache);
   }

   @Override
   public QueryFactory getQueryFactory() {
      EntityNamesResolver entityNamesResolver = new EntityNamesResolver() {
         @Override
         public Class<?> getClassFromName(String entityName) {
            Class clazz;
            try {
               clazz = Class.forName(entityName);
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.