1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package javax.jdo;
19
20 import javax.persistence.EntityManagerFactory;
21
22
23
24
25
26
27
28 public interface JDOEntityManagerFactory
29 extends EntityManagerFactory, PersistenceManagerFactory {
30
31 /** Get an instance of <code>JDOEntityManager</code> from this factory.
32 * The instance has default values for options. This method overrides
33 * the getPersistenceManager method from PersistenceManagerFactory.
34 *
35 * <P>After the first use of <code>getPersistenceManager</code>, no "set"
36 * methods will succeed.
37 *
38 * @return a <code>JDOEntityManager</code> instance with default options.
39 */
40 JDOEntityManager getPersistenceManager();
41
42 /** Get a thread-safe instance of a proxy that dynamically binds
43 * on each method call to an instance of <code>JDOEntityManager</code>.
44 * <P>When used with a <code>JDOEntityManagerFactory</code>
45 * that uses TransactionType JTA,
46 * the proxy can be used in a server to dynamically bind to an instance
47 * from this factory associated with the thread's current transaction.
48 * In this case, the close method is ignored, as the
49 * <code>PersistenceManager</code> is automatically closed when the
50 * transaction completes.
51 * <P>When used with a <code>JDOEntityManagerFactory</code>
52 * that uses TransactionType RESOURCE_LOCAL, the proxy uses an inheritable
53 * ThreadLocal to bind to an instance of <code>JDOEntityManager</code>
54 * associated with the thread. In this case, the close method executed
55 * on the proxy closes the <code>JDOEntityManager</code> and then
56 * clears the ThreadLocal.
57 * Use of this method does not affect the configurability of the
58 * <code>JDOEntityManagerFactory</code>.
59 *
60 * @since 2.1
61 * @return a <code>PersistenceManager</code> proxy.
62 */
63 JDOEntityManager getPersistenceManagerProxy();
64
65 /** Get an instance of <code>JDOEntityManager</code> from this factory.
66 * The instance has default values for options.
67 * The parameters <code>userid</code> and <code>password</code> are used
68 * when obtaining datastore connections from the connection pool.
69 *
70 * <P>After the first use of <code>getPersistenceManager</code>, no "set"
71 * methods will succeed.
72 *
73 * @return a <code>JDOEntityManager</code> instance with default options.
74 * @param userid the userid for the connection
75 * @param password the password for the connection
76 */
77 JDOEntityManager getPersistenceManager(String userid, String password);
78
79 }