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. 因?yàn)镻ersistenceManagerFactory 是一個(gè)接口,一些實(shí)現(xiàn)該接口的廠商特定的類必須通過一種“自舉”機(jī)制來使用。
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應(yīng)用程序和JDO實(shí)現(xiàn)的要點(diǎn)。應(yīng)用程序使用PersistenceManager 從數(shù)據(jù)存儲(chǔ)中獲得對(duì)象或者把一個(gè)Java對(duì)象放到數(shù)據(jù)存儲(chǔ)中。PersistenceManager 接口也為下面將要討論的幾個(gè)JDO組件提供服務(wù)。
public abstract void makePersistent(Object); public abstract void makePersistentAll(Object[]); public abstract void makePersistentAll(java.util.Collection);