Notice that this is a simple POJO with two fields: id and version. Public static EntityManagerFactory getEntityManagerFactory()ĮntityManagerFactory emf = Persistence.createEntityManagerFactory('hsqldb-ds') įortunately for us, Hibernate comes with a default logging configuration that shows us pretty much what we need, and if you are using it on a Java EE Application Server like JBoss AS or GlassFish then this logging is configured in the server itself however, if you want to customize the log output for our standalone Java SE demo, you’ll need to take a look at jboss-logging. You should note that we are also using the class to obtain an EntityManagerFactory The EntityManagerFactory controls connections to the database, and also gives you access to EntityManager instances.ĮntityManager is the API you’ll be using to actually interact with the database via SQL or JQL (JPA Query Language.) model.SimpleObjectĮntityManagerUtil is a convenience class that provides your application access to the active EntityManagerFactory.