コード例 #1
0
  /**
   * 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;
  }
コード例 #2
0
 public Object newObjectIdInstance(Class clazz, String str) {
   checkStatus();
   return pm.newObjectIdInstance(clazz, str);
 }
コード例 #3
0
 /**
  * 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);
 }
コード例 #4
0
 /**
  * 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();
 }
コード例 #5
0
 /**
  * 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);
 }
コード例 #6
0
 /**
  * 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);
 }
コード例 #7
0
 /**
  * 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);
 }
コード例 #8
0
 /**
  * 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);
 }
コード例 #9
0
 /**
  * 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);
 }
コード例 #10
0
 /**
  * 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);
 }
コード例 #11
0
 /**
  * JDO method to delete a Persistence Capable object
  *
  * @param pc Persistence Capable object
  */
 public void deletePersistent(Object pc) {
   checkStatus();
   pm.deletePersistent(pc);
 }
コード例 #12
0
 /**
  * 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);
 }
コード例 #13
0
 /**
  * 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);
 }
コード例 #14
0
 /**
  * Method to make an object persistent.
  *
  * @param pc The object to persist
  */
 public Object makePersistent(Object pc) {
   checkStatus();
   return pm.makePersistent(pc);
 }
コード例 #15
0
 /**
  * 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);
 }
コード例 #16
0
 /**
  * Make a Persistence-Capable object non-transactional
  *
  * @param pc Persistence-Capable object
  */
 public void makeNontransactional(Object pc) {
   checkStatus();
   pm.makeNontransactional(pc);
 }
コード例 #17
0
 /**
  * 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);
 }
コード例 #18
0
 /**
  * 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);
 }
コード例 #19
0
 /**
  * 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);
 }
コード例 #20
0
 /**
  * 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);
 }
コード例 #21
0
 /**
  * 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);
 }
コード例 #22
0
 /**
  * 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);
 }
コード例 #23
0
 /**
  * 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);
 }
コード例 #24
0
 /**
  * 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);
 }
コード例 #25
0
 /**
  * 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);
 }
コード例 #26
0
 /**
  * Make a Persistence-Capable object transient
  *
  * @param pc Persistence-Capable object
  */
 public void makeTransient(Object pc) {
   checkStatus();
   pm.makeTransient(pc);
 }
コード例 #27
0
 /**
  * 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);
 }
コード例 #28
0
 /**
  * Make an array of Persistence-Capable objects transient
  *
  * @param pcs Array of Persistence-Capable objects
  */
 public void makeTransientAll(Object... pcs) {
   checkStatus();
   pm.makeTransientAll(pcs);
 }
コード例 #29
0
 /**
  * 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);
 }
コード例 #30
0
 /**
  * Make a Collection of Persistence-Capable objects transient
  *
  * @param pcs Collection of Persistence-Capable objects
  */
 public void makeTransientAll(Collection pcs) {
   checkStatus();
   pm.makeTransientAll(pcs);
 }