![JAR search and dependency download from the Maven repository](/logo.png)
javax.jdo.JDOEntityManagerFactory Maven / Gradle / Ivy
Show all versions of jdo-api Show documentation
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package javax.jdo;
import javax.persistence.EntityManagerFactory;
/*
* JDOEntityManagerFactory.java
*
* @since 2.1
*
*/
public interface JDOEntityManagerFactory
extends EntityManagerFactory, PersistenceManagerFactory {
/** Get an instance of JDOEntityManager
from this factory.
* The instance has default values for options. This method overrides
* the getPersistenceManager method from PersistenceManagerFactory.
*
* After the first use of getPersistenceManager
, no "set"
* methods will succeed.
*
* @return a JDOEntityManager
instance with default options.
*/
JDOEntityManager getPersistenceManager();
/** Get a thread-safe instance of a proxy that dynamically binds
* on each method call to an instance of JDOEntityManager
.
*
When used with a JDOEntityManagerFactory
* that uses TransactionType JTA,
* the proxy can be used in a server to dynamically bind to an instance
* from this factory associated with the thread's current transaction.
* In this case, the close method is ignored, as the
* PersistenceManager
is automatically closed when the
* transaction completes.
*
When used with a JDOEntityManagerFactory
* that uses TransactionType RESOURCE_LOCAL, the proxy uses an inheritable
* ThreadLocal to bind to an instance of JDOEntityManager
* associated with the thread. In this case, the close method executed
* on the proxy closes the JDOEntityManager
and then
* clears the ThreadLocal.
* Use of this method does not affect the configurability of the
* JDOEntityManagerFactory
.
*
* @since 2.1
* @return a PersistenceManager
proxy.
*/
JDOEntityManager getPersistenceManagerProxy();
/** Get an instance of JDOEntityManager
from this factory.
* The instance has default values for options.
* The parameters userid
and password
are used
* when obtaining datastore connections from the connection pool.
*
*
After the first use of getPersistenceManager
, no "set"
* methods will succeed.
*
* @return a JDOEntityManager
instance with default options.
* @param userid the userid for the connection
* @param password the password for the connection
*/
JDOEntityManager getPersistenceManager(String userid, String password);
}