title: test hibernate entities with spring
body: <p>I try to tests how hibernate Entities are persisted to database. I have 5 tests for 3 Entitites. All my attempts are unsuccessful((( I tried to use @Transactional annotation to bind each test to one transaction. But I could not (tried all combinations). Now I try to test it manually creating sessions and transactions. But now problem is that I dont know how to create one session for all tests. I tried <em>@BeforeClass</em>, but here problem is that it is static and I use Spring beans for session creation. Any ideas how I can test hibernate Entities?</p>