Package org.hibernate.search

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


    final Session session = openSession();
    Transaction transaction = session.beginTransaction();
    final FullTextSession fts = Search.getFullTextSession( session );
    final Insurance insurance = new Insurance();
    insurance.setName( "Macif" );
    fts.persist( insurance );
    transaction.commit();

    fts.clear();

    transaction = fts.beginTransaction();
View Full Code Here


    getTransactionManager().begin();
    final EntityManager entityManager = getFactory().createEntityManager();
    final FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession( entityManager.unwrap( Session.class ) );
    final Insurance insurance = new Insurance();
    insurance.setName( "Macif" );
    ftSession.persist( insurance );
    getTransactionManager().commit();

    ftSession.clear();

    getTransactionManager().begin();
View Full Code Here

public class ExplanationTest extends SearchTestCase {
  public void testExplanation() throws Exception {
    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    Dvd dvd = new Dvd("The dark knight", "Batman returns with it best enomy the Jocker. The dark side of this movies shows up pretty quickly");
    s.persist( dvd );
    dvd = new Dvd("Wall-e", "The tiny little robot comes to Eartch 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 it best enomy the Jocker. The dark side of this movies shows up pretty quickly");
    s.persist( dvd );
    dvd = new Dvd("Wall-e", "The tiny little robot comes to Eartch 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

    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

    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

    englishArticle.setText( "acknowledgment" );
    englishArticle.setReferences( references );

    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    s.persist( englishArticle );
    tx.commit();

    tx = s.beginTransaction();

    // at query time we use a standard analyzer. We explicitly search for tokens which can only be found if the
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

    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

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.