List of usage examples for org.hibernate.event.spi PersistEvent getSession
public final EventSource getSession()
From source file:org.granite.tide.hibernate4.HibernatePersistListener.java
License:Open Source License
@Override public void onPersist(PersistEvent event) throws HibernateException { try {//from w w w . ja v a 2s. c om super.onPersist(event); } catch (StaleObjectStateException e) { HibernateOptimisticLockException.rethrowOptimisticLockException(event.getSession(), e); } }
From source file:org.granite.tide.hibernate4.HibernatePersistListener.java
License:Open Source License
@SuppressWarnings("rawtypes") @Override/* w w w. j av a2 s . co m*/ public void onPersist(PersistEvent event, Map copiedAlready) throws HibernateException { try { super.onPersist(event, copiedAlready); } catch (StaleObjectStateException e) { HibernateOptimisticLockException.rethrowOptimisticLockException(event.getSession(), e); } }