Package org.hibernate.search.bridge.builtin.impl

Examples of org.hibernate.search.bridge.builtin.impl.TwoWayString2FieldBridgeAdaptor


    if ( fieldBridge instanceof NullEncodingTwoWayFieldBridge ) {
      NullEncodingTwoWayFieldBridge encoding = (NullEncodingTwoWayFieldBridge) fieldBridge;
      return getTwoWayStringBridge( encoding.unwrap() );
    }
    else if ( fieldBridge instanceof TwoWayString2FieldBridgeAdaptor ) {
      TwoWayString2FieldBridgeAdaptor adaptor = (TwoWayString2FieldBridgeAdaptor) fieldBridge;
      return adaptor.unwrap();
    }
    else {
      return null;
    }
  }
View Full Code Here


  public FieldBridge provideFieldBridge(BridgeProviderContext bridgeProviderContext) {
    if ( bridgeProviderContext.getReturnType().isEnum() ) {
      //we return one enum type bridge instance per property as it is customized per ReturnType
      final EnumBridge enumBridge = new EnumBridge();
      //AppliedOnTypeAwareBridge is called in a generic way later and fills up the enum type to the bridge
      return new TwoWayString2FieldBridgeAdaptor( enumBridge );
    }
    return null;
  }
View Full Code Here

    Uri = new TwoWayString2FieldBridgeAdaptor( new UriBridge() );
    UUID = new TwoWayString2FieldBridgeAdaptor( new UUIDBridge() );
  }

  public BasicJDKTypesBridgeProvider(ServiceManager serviceManager) {
    clazz = new TwoWayString2FieldBridgeAdaptor( new org.hibernate.search.bridge.builtin.ClassBridge( serviceManager ) );
    builtInBridges = new HashMap<String, FieldBridge>();
    builtInBridges.put( Character.class.getName(), CHARACTER );
    builtInBridges.put( char.class.getName(), CHARACTER );
    builtInBridges.put( Double.class.getName(), DOUBLE );
    builtInBridges.put( double.class.getName(), DOUBLE );
View Full Code Here

          Object instance = bridgeType.newInstance();
          if ( FieldBridge.class.isAssignableFrom( bridgeType ) ) {
            bridge = (FieldBridge) instance;
          }
          else if ( org.hibernate.search.bridge.TwoWayStringBridge.class.isAssignableFrom( bridgeType ) ) {
            bridge = new TwoWayString2FieldBridgeAdaptor(
                (org.hibernate.search.bridge.TwoWayStringBridge) instance
            );
          }
          else if ( org.hibernate.search.bridge.StringBridge.class.isAssignableFrom( bridgeType ) ) {
            bridge = new String2FieldBridgeAdaptor( (org.hibernate.search.bridge.StringBridge) instance );
View Full Code Here

      Object instance = impl.newInstance();
      if ( FieldBridge.class.isAssignableFrom( impl ) ) {
        bridge = (FieldBridge) instance;
      }
      else if ( TwoWayStringBridge.class.isAssignableFrom( impl ) ) {
        bridge = new TwoWayString2FieldBridgeAdaptor(
            (TwoWayStringBridge) instance
        );
      }
      else if ( org.hibernate.search.bridge.StringBridge.class.isAssignableFrom( impl ) ) {
        bridge = new String2FieldBridgeAdaptor( (org.hibernate.search.bridge.StringBridge) instance );
View Full Code Here

    if ( providedId != null ) {
      providedIdFieldBridge = bridgeFactory.extractTwoWayType( providedId.bridge(), clazz, reflectionManager );
      providedIdFieldName = providedId.name();
    }
    else {
      providedIdFieldBridge = new TwoWayString2FieldBridgeAdaptor( org.hibernate.search.bridge.builtin.StringBridge.INSTANCE );
      providedIdFieldName = ProvidedId.defaultFieldName;
    }

    DocumentFieldMetadata fieldMetadata =
        new DocumentFieldMetadata.Builder(
View Full Code Here

                     return NumericFieldBridge.INT_FIELD_BRIDGE;
                  case STRING:
                  case BYTES:
                  case GROUP:
                  case MESSAGE:
                     return new NullEncodingTwoWayFieldBridge(new TwoWayString2FieldBridgeAdaptor(StringBridge.INSTANCE), NULL_TOKEN);
               }
               return null;
            }
         };
View Full Code Here

      providedIdFieldBridge = BridgeFactory.extractTwoWayType( provided.bridge(), clazz, reflectionManager );
      providedIdFieldName = provided.name();
      idProvided = true;
    }
    else if ( context.isProvidedIdImplicit() ) {
      providedIdFieldBridge = new TwoWayString2FieldBridgeAdaptor( org.hibernate.search.bridge.builtin.StringBridge.INSTANCE );
      providedIdFieldName = ProvidedId.defaultFieldName;
      idProvided = true;
    }

    if ( idProvided ) {
View Full Code Here

    private final Map<String, Map<String, FieldBridge>> bridgesByType = new HashMap<String, Map<String, FieldBridge>>();

    private TestFieldBridgeProvider() {
      Map<String, FieldBridge> indexedEntityBridges = new HashMap<String, FieldBridge>();

      indexedEntityBridges.put( "id", new TwoWayString2FieldBridgeAdaptor( new StringBridge() ) );
      indexedEntityBridges.put( "name", new NullEncodingTwoWayFieldBridge( new TwoWayString2FieldBridgeAdaptor( new StringBridge() ), "_null_" ) );
      indexedEntityBridges.put( "position", NumericFieldBridge.LONG_FIELD_BRIDGE );
      indexedEntityBridges.put( "title", new TwoWayString2FieldBridgeAdaptor( new StringBridge() ) );
      indexedEntityBridges.put( "author", new NullEncodingFieldBridge( new String2FieldBridgeAdaptor( DefaultStringBridge.INSTANCE ), "_null_" ) );
      indexedEntityBridges.put( "author.name", new TwoWayString2FieldBridgeAdaptor( new StringBridge() ) );

      bridgesByType.put( "IndexedEntity", indexedEntityBridges );
    }
View Full Code Here

          Object instance = impl.newInstance();
          if ( FieldBridge.class.isAssignableFrom( impl ) ) {
            bridge = (FieldBridge) instance;
          }
          else if ( org.hibernate.search.bridge.TwoWayStringBridge.class.isAssignableFrom( impl ) ) {
            bridge = new TwoWayString2FieldBridgeAdaptor(
                (org.hibernate.search.bridge.TwoWayStringBridge) instance
            );
          }
          else if ( org.hibernate.search.bridge.StringBridge.class.isAssignableFrom( impl ) ) {
            bridge = new String2FieldBridgeAdaptor( (org.hibernate.search.bridge.StringBridge) instance );
View Full Code Here

TOP

Related Classes of org.hibernate.search.bridge.builtin.impl.TwoWayString2FieldBridgeAdaptor

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.