public PersistenceManager getPersistenceManager() public PersistenceManager getPersistenceManager(String userid, String passWord)
Because PersistenceManagerFactory is an interface, some vendor specific class, which implements this interface, must be used as a bootstrap mechanism. This should turn out to be the only vendor specific code that a JDO application uses. Because of this, the JDO specification suggests that an application level factory class be implemented which returns the apPRopriate instance of the PersistenceManagerFactory so that implementations may be swapped out with minimal impact on application code. Only the application's factory would need to be modified in this case. 因为PersistenceManagerFactory 是一个接口,一些实现该接口的厂商特定的类必须通过一种“自举”机制来使用。
The PersistenceManager interface is the primary point of contact between a Java application and the JDO implementation. Application code uses a PersistenceManager to retrieve Java objects from the data store and to add Java objects to the data store. The PersistenceManager interface also serves as a factory for several other JDO components discussed below. PersistenceManager 接口是连接Java应用程序和JDO实现的要点。应用程序使用PersistenceManager 从数据存储中获得对象或者把一个Java对象放到数据存储中。PersistenceManager 接口也为下面将要讨论的几个JDO组件提供服务。
PersistenceManager 接口中定义了几个方法来把JDO实例对象添加到数据存储中。
public abstract void makePersistent(Object); public abstract void makePersistentAll(Object[]); public abstract void makePersistentAll(java.util.Collection);