Package org.hibernate.search

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


      Domain mysqlDomain = (Domain) session.load( Domain.class, 8 );
      session.delete( mysqlDomain );
      Domain newDomain = new Domain( 8, "something.org" );
      session.persist( newDomain );
      session.delete( newDomain );
      session.persist( new Domain( 8, "somethingnew.org" ) );
      session.getTransaction().commit();
    }
    assertEquals( 1, countDomainsByFullText( "somethingnew" ) );

    session.close();
View Full Code Here


    for (int i = 0; i < loop; i++) {
      Email email = new Email();
      email.setId( (long) i + 1 );
      email.setTitle( "JBoss World Berlin" );
      email.setBody( "Meet the guys who wrote the software" );
      s.persist( email );
    }
    tx.commit();
    s.close();

    s = Search.createFullTextSession( openSession() );
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

    en.setProperty( "Property" );
    en.setComponent( new MyComponent() );
    en.getComponent().setComponentProperty( "component property" );
    FullTextSession s = Search.createFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    s.persist( en );
    tx.commit();

    tx = s.beginTransaction();
    QueryParser parser = new QueryParser("id", new StandardAnalyzer() );
    org.apache.lucene.search.Query luceneQuery = parser.parse( "entity:alarm");
View Full Code Here

    for (int i = 0; i < loop; i++) {
      Email email = new Email();
      email.setId( (long) i + 1 );
      email.setTitle( "JBoss World Berlin" );
      email.setBody( "Meet the guys who wrote the software" );
      s.persist( email );
    }
    tx.commit();
    s.close();

    //check non created object does get found!!1
View Full Code Here

    en.setProperty( "Property" );
    en.setComponent( new MyComponent() );
    en.getComponent().setComponentProperty( "component property" );
    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    s.persist( en );
    tx.commit();

    tx = s.beginTransaction();
    QueryParser parser = new QueryParser( "id", new StandardAnalyzer() );
    org.apache.lucene.search.Query luceneQuery = parser.parse( "entity:alarm" );
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

    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

    en.setEntity( "anyNotNull" );
    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

    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

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.