Package org.hibernate.search

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


    tx = s.beginTransaction();

    Item loaded = (Item) s.get( Item.class, item.getId() );
    loaded.setDescription( "Ferrari" );

    s.update( loaded );
    tx.commit();

    tx = s.beginTransaction();

    parser = new QueryParser( TestConstants.getTargetLuceneVersion(), "id", TestConstants.standardAnalyzer );
View Full Code Here


    SimpleChildEntity child = new SimpleChildEntity( parent );
    session.save( child );

    parent.setChild( child );
    session.update( parent );

    tx.commit();
    session.close();

    // assert that everything got saved correctly
View Full Code Here

    // update the parent name
    session = Search.getFullTextSession( openSession() );
    tx = session.beginTransaction();
    parent.setName( "newname2" );
    session.update( parent );
    tx.commit();
    session.close();

    // check that the SimpleChildEntity has been reindexed correctly
    session = Search.getFullTextSession( openSession() );
View Full Code Here

    // add a new reference code to the model: this should also trigger a reindex of the ProductShootingBrief
    // due to the @ContainedIn dependency graph
    session = Search.getFullTextSession( openSession() );
    tx = session.beginTransaction();
    model.getAdditionalReferenceCodes().add( new ProductReferenceCode( model, "NEWREF" ) );
    session.update( model );
    tx.commit();
    session.close();

    // check that the ProductShootingBrief has been reindexed correctly.
    session = Search.getFullTextSession( openSession() );
View Full Code Here

    // now unload the truck "LVN 746 XD" because his driver, Mark Smith, arrived at his destination.
    truckLVN746XD.setItems( null );
    // let's update
    session = Search.getFullTextSession( openSession() );
    tx = session.beginTransaction();
    session.update( driverSmith );
    // if the Hibernate-Search release is 3.4.0.CR2, it throws NullPointerException described in HSEARCH-734 during
    // commit phase
    tx.commit();
    session.close();
View Full Code Here

    dad2.setGrandpa( target );

    session = Search.getFullTextSession( openSession() );
    tx = session.beginTransaction();

    session.update( dad1 );
    session.update( dad2 );

    tx.commit();
    session.close();
View Full Code Here

    session = Search.getFullTextSession( openSession() );
    tx = session.beginTransaction();

    session.update( dad1 );
    session.update( dad2 );

    tx.commit();
    session.close();

    //all right, let's assert that indexes got updated correctly
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.