Hibernate Documentation - consider deleting

Transactional services / Spring integration

Service classes or methods should be marked @Transactional to provide access to the underlying Hibernate Session / SessionFactory.


Frequently executed HQL queries should be specified in @NamedQueryS on the relevant persistent entity/bean. The hibernate DAOs then reference the appropriate NamedQuery within their methods.

Useful tools

To run HQL queries and inspect the hibernate setup within Eclipse you can install the hibernate tools Eclipse plugin from JBoss by adding this update site to your Eclipse plugins registry (under Help -> Software Updates) - http://download.jboss.org/jbosstools/updates/development

You'll need to configure the plugin appropriately by providing the locations to the src/main/webapp/WEB-INF/hibernate.cfg.xml and hibernate.properties files.

Hibernate Collections

In order to remove an entity from a one-to-many or many-to-many relationship you must:

  1. remove that entity from the persistent collection that it belongs to, e.g.,

    TemporalTerm temporalTerm = ...;

Hibernate annotation schema mapping docs: http://www.hibernate.org/hib_docs/annotations/reference/en/html/
Enable second level caching via EHCache - http://www.devx.com/dbzone/Article/29685/1954?pf=true