private Transaction transaction;
@BeforeClass
public static void addTestEntities() {
Session session = sessions.openSession();
Transaction transaction = session.getTransaction();
transaction.begin();
Hypothesis hypothesis = new Hypothesis();
hypothesis.setId( "1" );
hypothesis.setPosition( 1 );
hypothesis.setDescription( "Alea iacta est." );
session.persist( hypothesis );
hypothesis = new Hypothesis();
hypothesis.setId( "2" );
hypothesis.setPosition( 2 );
hypothesis.setDescription( "Ne vadis..." );
session.persist( hypothesis );
hypothesis = new Hypothesis();
hypothesis.setId( "3" );
hypothesis.setPosition( 3 );
hypothesis.setDescription( "Omne initium difficile est." );
session.persist( hypothesis );
hypothesis = new Hypothesis();
hypothesis.setId( "4" );
hypothesis.setPosition( 4 );
hypothesis.setDescription( "Nomen est omen." );
session.persist( hypothesis );
hypothesis = new Hypothesis();
hypothesis.setId( "5" );
hypothesis.setPosition( 5 );
hypothesis.setDescription( "Quo vadis?" );
session.persist( hypothesis );
hypothesis = new Hypothesis();
hypothesis.setId( "6" );
hypothesis.setPosition( 6 );
hypothesis.setDescription( "Ne vadis." );
session.persist( hypothesis );
hypothesis = new Hypothesis();
hypothesis.setId( "7" );
hypothesis.setPosition( 7 );
hypothesis.setDescription( "100% scientia" );
session.persist( hypothesis );
hypothesis = new Hypothesis();
hypothesis.setId( "8" );
hypothesis.setPosition( 8 );
hypothesis.setDescription( "100\nscientiae" );
session.persist( hypothesis );
transaction.commit();
session.clear();
session.close();
}