Package org.hibernate.search

Examples of org.hibernate.search.FullTextSession.persist()


    AlarmEntity alarmEn = new AlarmEntity();
    alarmEn.setProperty( "notNullAgain" );
    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    s.persist( en );
    s.persist( alarmEn );
    tx.commit();

    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "id", new StandardAnalyzer() );
    {
View Full Code Here


    team.setName( "ATL team" );

    // persist and index the test object
    FullTextSession fts = Search.getFullTextSession( openSession() );
    Transaction tx = fts.beginTransaction();
    fts.persist( team );
    tx.commit();
    fts.clear();

    // execute several search to show that the right tokenizers were applies
    tx = fts.beginTransaction();
View Full Code Here

    FullTextSession fullTextSession = fulltextSessionBuilder.openFullTextSession();
    try {
      final Transaction transaction = fullTextSession.beginTransaction();

      LocationGroup group = new LocationGroup( "Floor 1" );
      fullTextSession.persist( group );

      for ( int i = 0; i < 5; i++ ) {
        Location location = new Location( "Room 10" + i );
        fullTextSession.persist( location );
View Full Code Here

      LocationGroup group = new LocationGroup( "Floor 1" );
      fullTextSession.persist( group );

      for ( int i = 0; i < 5; i++ ) {
        Location location = new Location( "Room 10" + i );
        fullTextSession.persist( location );

        group.getLocations().add( location );
        location.setLocationGroup( group );
        fullTextSession.merge( group );
      }
View Full Code Here

    emailAddress.setDefaultAddress( true );

    person.addEmailAddress( emailAddress );

    // persist the customer
    s.persist( person );
    tx.commit();

    // search if the record made it into the index
    tx = s.beginTransaction();
    String searchQuery = "Joe";
View Full Code Here

      final Transaction transaction = fullTextSession.beginTransaction();

      Catalog catalog = new Catalog();
      catalog.setCatalogId( 1L );
      catalog.setName( "parts" );
      fullTextSession.persist( catalog );

      for ( int i = 0; i < 5; i++ ) {
        Item item = new Item();
        item.setName( "battery" );
        fullTextSession.persist( item );
View Full Code Here

      fullTextSession.persist( catalog );

      for ( int i = 0; i < 5; i++ ) {
        Item item = new Item();
        item.setName( "battery" );
        fullTextSession.persist( item );

        CatalogItem catalogItem = new CatalogItem();
        catalogItem.setCatalog( catalog );
        catalogItem.setItem( item );
        fullTextSession.persist( catalogItem );
View Full Code Here

        fullTextSession.persist( item );

        CatalogItem catalogItem = new CatalogItem();
        catalogItem.setCatalog( catalog );
        catalogItem.setItem( item );
        fullTextSession.persist( catalogItem );

        item.getCatalogItems().add( catalogItem );
        fullTextSession.merge( item );

        catalog.getCatalogItems().add( catalogItem );
View Full Code Here

    searchFactory = session.getSearchFactory();

    // create some different domains:
    {
      session.beginTransaction();
      session.persist( new Domain( 1, "jboss.org" ) );
      session.persist( new Domain( 2, "jboss.com" ) );
      session.persist( new Domain( 3, "hibernate.org" ) );
      session.persist( new Domain( 4, "geocities.com" ) );
      session.getTransaction().commit();
    }
View Full Code Here

    // create some different domains:
    {
      session.beginTransaction();
      session.persist( new Domain( 1, "jboss.org" ) );
      session.persist( new Domain( 2, "jboss.com" ) );
      session.persist( new Domain( 3, "hibernate.org" ) );
      session.persist( new Domain( 4, "geocities.com" ) );
      session.getTransaction().commit();
    }
    assertEquals( 2, countDomainsByFullText( "jboss" ) );
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.