Package org.hibernate.search

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


      Transaction transaction = fullTextSession.beginTransaction();
      ExtendedIssueEntity issue = new ExtendedIssueEntity();
      issue.jiraCode = "HSEARCH-977";
      issue.jiraDescription = "MassIndexer freezes when there is an indexed 'id' filed, which is not document's id";
      issue.id = 1l;
      fullTextSession.persist( issue );
      transaction.commit();
      fullTextSession.close();
    }
    {
      //verify index is still empty:
View Full Code Here


  public void testBySearch() throws Exception {
    SubClass testClass = new SubClass();
    testClass.setName( "Proca\u00EFne" );
    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    s.persist( testClass );
    tx.commit();

    tx = s.beginTransaction();

View Full Code Here

    {
      //creating the test data in database only:
      FullTextSession fullTextSession = ftsb.openFullTextSession();
      Transaction transaction = fullTextSession.beginTransaction();
      Nation us = new Nation( "United States of America", "US" );
      fullTextSession.persist( us );
      Dvd dvda = new Dvd();
      dvda.setTitle( "Star Trek (episode 96367)" );
      dvda.setFirstPublishedIn( us );
      fullTextSession.save( dvda );
      Dvd dvdb = new Dvd();
View Full Code Here

  @Test
  public void testExplanation() throws Exception {
    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    Dvd dvd = new Dvd("The dark knight", "Batman returns with his best enemy the Joker. The dark side of this movies shows up pretty quickly");
    s.persist( dvd );
    dvd = new Dvd("Wall-e", "The tiny little robot comes to Earth after the dark times and tries to clean it");
    s.persist( dvd );
    tx.commit();
    s.clear();
View Full Code Here

    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    Dvd dvd = new Dvd("The dark knight", "Batman returns with his best enemy the Joker. The dark side of this movies shows up pretty quickly");
    s.persist( dvd );
    dvd = new Dvd("Wall-e", "The tiny little robot comes to Earth after the dark times and tries to clean it");
    s.persist( dvd );
    tx.commit();
    s.clear();

    tx = s.beginTransaction();
    Map<String, Float> boosts = new HashMap<String, Float>(2);
View Full Code Here

    super.setUp();
    FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
    Transaction tx = fullTextSession.beginTransaction();
    for ( int i = 0; i < 100; i++ ) {
      TestEntity entity = new TestEntity( i, "document-" + i );
      fullTextSession.persist( entity );
    }
    tx.commit();
    fullTextSession.close();
  }
View Full Code Here

    Transaction transaction = fullTextSession.beginTransaction();
    Item ssd = new Item();
    ssd.setDescription( "intel solid state disk" );
    Item wd = new Item();
    wd.setDescription( "western digital hibrid disk" );
    fullTextSession.persist( ssd );
    fullTextSession.persist( wd );
    transaction.commit();
    fullTextSession.close();
  }
View Full Code Here

    Item ssd = new Item();
    ssd.setDescription( "intel solid state disk" );
    Item wd = new Item();
    wd.setDescription( "western digital hibrid disk" );
    fullTextSession.persist( ssd );
    fullTextSession.persist( wd );
    transaction.commit();
    fullTextSession.close();
  }

  // trick to perform the same test on three different configurations:
View Full Code Here

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

    tx = s.beginTransaction();
    QueryParser parser = new QueryParser(
View Full Code Here

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

    tx = s.beginTransaction();
    QueryParser parser = new QueryParser(
        TestConstants.getTargetLuceneVersion(),
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.