1 16 17 package org.springframework.orm.toplink.support; 18 19 import oracle.toplink.sessions.Session; 20 21 import org.springframework.beans.factory.FactoryBean; 22 import org.springframework.orm.toplink.SessionFactory; 23 24 61 public class TransactionAwareSessionAdapter implements FactoryBean { 62 63 private Session session; 64 65 66 72 public void setSessionFactory(SessionFactory sessionFactory) { 73 this.session = sessionFactory.createTransactionAwareSession(); 74 } 75 76 77 public Object getObject() { 78 return this.session; 79 } 80 81 public Class getObjectType() { 82 return Session.class; 83 } 84 85 public boolean isSingleton() { 86 return true; 87 } 88 89 } 90 | Popular Tags |