Package org.hibernate.search.cfg

Examples of org.hibernate.search.cfg.SearchMapping.entity()


    * where people can not (or don't want to) use Annotations.
    */
   @Test
   public void testSearchMapping() {
      final SearchMapping mapping = new SearchMapping();
      mapping.entity(BondPVO.class).indexed()
            .property("id", ElementType.METHOD).field()
            .property("name", ElementType.METHOD).field()
            .property("isin", ElementType.METHOD).field();

      final Properties properties = new Properties();
View Full Code Here


            amendedProperties.put(Environment.MODEL_MAPPING, mapping);
            indexingProperties = amendedProperties;
         }
         Cache cache = cr.getComponent(Cache.class);
         FieldBridge fb = (FieldBridge) fbClass.getConstructor(Cache.class).newInstance(cache);
         mapping.entity(Util.loadClassStrict("org.infinispan.query.remote.indexing.ProtobufValueWrapper", cl))
               .indexed().classBridgeInstance(fb).norms(Norms.NO).analyze(Analyze.YES).store(Store.YES);
      } catch (Exception e) {
         throw new CacheException("Failed to configure indexing for remote query", e);
      }
      return indexingProperties;
View Full Code Here

    * where people can not (or don't want to) use Annotations.
    */
   @Test
   public void testSearchMapping() {
      final SearchMapping mapping = new SearchMapping();
      mapping.entity(BondPVO.class).indexed()
            .property("id", ElementType.METHOD).field()
            .property("name", ElementType.METHOD).field()
            .property("isin", ElementType.METHOD).field();

      final Properties properties = new Properties();
View Full Code Here

    * where people can not (or don't want to) use Annotations.
    */
   @Test
   public void testSearchMapping() {
      final SearchMapping mapping = new SearchMapping();
      mapping.entity(BondPVO.class).indexed()
            .property("id", ElementType.METHOD).field()
            .property("name", ElementType.METHOD).field()
            .property("isin", ElementType.METHOD).field();

      final Properties properties = new Properties();
View Full Code Here

        .addAnnotatedClass( CatalogItem.class )
        .addAnnotatedClass( Consumer.class )
        .addAnnotatedClass( Item.class );
    SearchMapping fluentMapping = builder.fluentMapping();
    // mapping for Catalog
    EntityMapping catalogMapping = fluentMapping
        .entity( Catalog.class );
    if ( withClassBridgeOnCatalog ) {
      catalogMapping.classBridge( NoopClassBridge.class );
    }
    catalogMapping
View Full Code Here

    }
    catalogMapping
        .property( "catalogItems", ElementType.FIELD ).containedIn();

    // mapping for CatalogItem
    fluentMapping.entity( CatalogItem.class )
        .property( "item", ElementType.FIELD ).containedIn()
        .property( "catalog", ElementType.FIELD ).indexEmbedded();

    // mapping for Item
    IndexedMapping itemMapping = fluentMapping
View Full Code Here

    fluentMapping.entity( CatalogItem.class )
        .property( "item", ElementType.FIELD ).containedIn()
        .property( "catalog", ElementType.FIELD ).indexEmbedded();

    // mapping for Item
    IndexedMapping itemMapping = fluentMapping
        .entity( Item.class )
        .indexed();
    if ( withClassBridgeOnItem ) {
      itemMapping.classBridge( NoopClassBridge.class );
    }
View Full Code Here

  @Override
  protected void configure(Configuration cfg) {
    super.configure( cfg );
    SearchMapping mapping = new SearchMapping();
    mapping
      .entity( PlainPerson.class )
        .indexed()
      .property( "id", ElementType.FIELD )
        .documentId()
        .bridge( PersonPKBridge.class )
View Full Code Here

    static FieldCacheType[] enableFieldCache;

    @Factory
    public SearchMapping build() {
      SearchMapping mapping = new SearchMapping();
      mapping
          .entity( Address.class )
            .indexed()
            .cacheFromIndex( enableFieldCache )
            .indexName( "single-index" )
          .entity( Country.class )
View Full Code Here

  }

  private SearchMapping createSearchMapping() {
    SearchMapping mapping = new SearchMapping();

    mapping.entity( ProgrammaticConfiguredValue.class )
        .indexed()
        .property( "id", ElementType.FIELD ).documentId().name( "id" )
        .property( "value", ElementType.FIELD ).field().store( Store.YES ).indexNullAs( "@null@" );
    return mapping;
  }
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.