Revision 815a9015
Added by Katja Luther about 6 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/DaoBase.java | ||
---|---|---|
26 | 26 |
import org.hibernate.Session; |
27 | 27 |
import org.hibernate.SessionFactory; |
28 | 28 |
import org.springframework.beans.factory.annotation.Autowired; |
29 |
import org.springframework.transaction.PlatformTransactionManager; |
|
29 | 30 |
|
30 | 31 |
import eu.etaxonomy.cdm.persistence.query.OrderHint; |
31 | 32 |
|
... | ... | |
36 | 37 |
@Autowired |
37 | 38 |
private SessionFactory factory; |
38 | 39 |
|
40 |
@Autowired |
|
41 |
private PlatformTransactionManager transactionManager; |
|
42 |
|
|
39 | 43 |
public void setSessionFactory(SessionFactory sessionFactory) { |
40 | 44 |
this.factory = sessionFactory; |
41 | 45 |
} |
... | ... | |
45 | 49 |
protected Session getSession(){ |
46 | 50 |
Session session ; |
47 | 51 |
try { |
52 |
|
|
48 | 53 |
session = factory.getCurrentSession(); |
49 | 54 |
} catch (HibernateException e) { |
50 | 55 |
logger.error("Opening new session in turn of a HibernateException", e); |
Also available in: Unified diff
adapted deleteResult