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);