KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > orm > toplink > MockSessionFactory


1
2 package org.springframework.orm.toplink;
3
4 import oracle.toplink.sessions.Session;
5
6 /**
7  * @author Juergen Hoeller
8  * @since 28.04.2005
9  */

10 public class MockSessionFactory implements SessionFactory {
11
12     private Session session;
13
14     public MockSessionFactory(Session session) {
15         this.session = session;
16     }
17
18     public void setSession(Session session) {
19         this.session = session;
20     }
21
22     public Session createSession() {
23         return this.session;
24     }
25
26     public Session createManagedClientSession() {
27         return this.session;
28     }
29
30     public Session createTransactionAwareSession() {
31         return this.session;
32     }
33
34     public void close() {
35     }
36
37 }
38
Popular Tags