/** * Method to close the Persistence Manager. This is invoked by the application server if this * handle is not closed */ public void close() { assertIsOpen(); LOGGER.debug("Closing handle " + this); if (pm != null) { pm.flush(); mc.notifyClosed(this); } closed = true; }
public Object newObjectIdInstance(Class clazz, String str) { checkStatus(); return pm.newObjectIdInstance(clazz, str); }
/** * Mutator for the multithreaded capability of the manager * * @param multithreaded Whether to run multithreaded or not */ public void setMultithreaded(boolean multithreaded) { checkStatus(); pm.setMultithreaded(multithreaded); }
/** * The application might manage PersistenceManager instances by using an associated object for * bookkeeping purposes. These methods allow the user to manage the associated object. The * parameter is not inspected or used in any way by the JDO implementation.* * * @return User object */ public Object getUserObject() { checkStatus(); return pm.getUserObject(); }
/** * Method to remove a user object from the PersistenceManager. This is for user objects which are * stored under a key. <I>The parameter is not inspected or used in any way by the JDO * implementation. </I> * * @param key The key whose user object is to be removed. * @return The user object that was removed * @since 1.1 */ public synchronized Object removeUserObject(Object key) { checkStatus(); return pm.removeUserObject(key); }
/** * Method to put a user object into the PersistenceManager. This is so that multiple users can * each have a user object for example. <I>The parameter is not inspected or used in any way by * the JDO implementation. </I> * * @param key The key to store the user object under * @param value The object to store * @return The previous value for this key * @since 1.1 */ public synchronized Object putUserObject(Object key, Object value) { checkStatus(); return pm.putUserObject(key, value); }
/** * Detach the specified objects from the <code>PersistenceManager</code>. The objects returned can * be manipulated and re-attached with {@link #makePersistentAll(Object[])}. The detached * instances will be unmanaged copies of the specified parameters, and are suitable for * serialization and manipulation outside of a JDO environment. When detaching instances, only * fields in the current {@link FetchPlan} will be traversed. Thus, to detach a graph of objects, * relations to other persistent instances must either be in the <code>default-fetch-group</code>, * or in the current custom {@link FetchPlan}. * * @param pcs the instances to detach * @return the detached instances * @throws javax.jdo.JDOUserException if any of the instances do not * @see #makePersistentAll(Object[]) * @see #getFetchPlan */ public synchronized Object[] detachCopyAll(Object... pcs) { checkStatus(); return pm.detachCopyAll(pcs); }
/** * Make a Collection of Persistence-Capable objects non-transactional * * @param pcs Collection of Persistence-Capable objects */ public void makeNontransactionalAll(Collection pcs) { checkStatus(); pm.makeNontransactionalAll(pcs); }
/** * JDO method to delete a Collection of Persistence Capable objects * * @param pcs Collection of Persistence Capable objects */ public void deletePersistentAll(Collection pcs) { checkStatus(); pm.deletePersistentAll(pcs); }
/** * JDO method to delete an array of Persistence Capable objects * * @param pcs Array of Persistence Capable objects */ public void deletePersistentAll(Object... pcs) { checkStatus(); pm.deletePersistentAll(pcs); }
/** * JDO method to delete a Persistence Capable object * * @param pc Persistence Capable object */ public void deletePersistent(Object pc) { checkStatus(); pm.deletePersistent(pc); }
/** * Make a Collection of Persistence Capable objects persistent * * @param pcs Collection of Persistence Capable objects */ public Collection makePersistentAll(Collection pcs) { checkStatus(); return pm.makePersistentAll(pcs); }
/** * Make an array of Persistent Capable objects persistent * * @param pcs Array of Persistent Capable objects */ public Object[] makePersistentAll(Object... pcs) { checkStatus(); return pm.makePersistentAll(pcs); }
/** * Method to make an object persistent. * * @param pc The object to persist */ public Object makePersistent(Object pc) { checkStatus(); return pm.makePersistent(pc); }
/** * Method to create an instance of an interface or abstract class * * @param pc interface/abstract class declared in metadata * @return Instance of the interface / abstract class */ public Object newInstance(Class pc) { checkStatus(); return pm.newInstance(pc); }
/** * Make a Persistence-Capable object non-transactional * * @param pc Persistence-Capable object */ public void makeNontransactional(Object pc) { checkStatus(); pm.makeNontransactional(pc); }
/** * Make an array of Persistence-Capable objects non-transactional * * @param pcs Array of Persistence-Capable objects */ public void makeNontransactionalAll(Object... pcs) { checkStatus(); pm.makeNontransactionalAll(pcs); }
/** * Make a Persistence-Capable object transient , optionally using the fetch plan. * * @param pc Persistence-Capable object * @param useFetchPlan Whether to use the fetch plan */ public void makeTransient(Object pc, boolean useFetchPlan) { checkStatus(); pm.makeTransient(pc, useFetchPlan); }
/** * Detach the specified object from the <code>PersistenceManager</code>. * * @param pc the instance to detach * @return the detached instance * @see #detachCopyAll(Object[]) * @since JDO 2.0 */ public synchronized Object detachCopy(Object pc) { checkStatus(); return pm.detachCopy(pc); }
/** * Make an array of Persistence-Capable objects transient * * @param pcs Array of Persistence-Capable objects * @param useFetchPlan Whether to use the fetch plan */ public void makeTransientAll(Object[] pcs, boolean useFetchPlan) { checkStatus(); pm.makeTransientAll(useFetchPlan, pcs); }
/** * Detach the specified objects from the <code>PersistenceManager</code>. * * @param pcs the instances to detach * @return the detached instances * @see #detachCopyAll(Object[]) */ public synchronized Collection detachCopyAll(Collection pcs) { checkStatus(); return pm.detachCopyAll(pcs); }
/** * Make an array of Persistence-Capable objects transient * * @param useFetchPlan Whether to use the fetch plan * @param pcs Array of Persistence-Capable objects * @since JDO 2.1 */ public void makeTransientAll(boolean useFetchPlan, Object... pcs) { checkStatus(); pm.makeTransientAll(useFetchPlan, pcs); }
/** * Method to get a user object from the PersistenceManager. This is for user objects which are * stored under a key. <I>The parameter is not inspected or used in any way by the JDO * implementation. </I> * * @param key The key to store the user object under * @return The user object for that key * @since 1.1 */ public synchronized Object getUserObject(Object key) { checkStatus(); return pm.getUserObject(key); }
/** * Make a Collection of Persistence-Capable objects transient * * @param pcs Collection of Persistence-Capable objects * @param useFetchPlan Whether to use the fetch plan */ public void makeTransientAll(Collection pcs, boolean useFetchPlan) { checkStatus(); pm.makeTransientAll(pcs, useFetchPlan); }
/** * The application might manage PersistenceManager instances by using an associated object for * bookkeeping purposes. These methods allow the user to manage the associated object. The * parameter is not inspected or used in any way by the JDO implementation. * * @param obj User Object */ public void setUserObject(Object obj) { checkStatus(); pm.setUserObject(obj); }
/** * Make a Persistence-Capable object transient * * @param pc Persistence-Capable object */ public void makeTransient(Object pc) { checkStatus(); pm.makeTransient(pc); }
/** * Retrieve the class for the objectid * * @param clazz The class to retrieve * @return The Class of the ObjectId */ public Class getObjectIdClass(Class clazz) { checkStatus(); return pm.getObjectIdClass(clazz); }
/** * Make an array of Persistence-Capable objects transient * * @param pcs Array of Persistence-Capable objects */ public void makeTransientAll(Object... pcs) { checkStatus(); pm.makeTransientAll(pcs); }
/** * Mutator for whether to ignore the cache or not * * @param ignore Whether to ignore the cache or not */ public void setIgnoreCache(boolean ignore) { checkStatus(); pm.setIgnoreCache(ignore); }
/** * Make a Collection of Persistence-Capable objects transient * * @param pcs Collection of Persistence-Capable objects */ public void makeTransientAll(Collection pcs) { checkStatus(); pm.makeTransientAll(pcs); }