Package javax.jdo

Examples of javax.jdo.PersistenceManager.makePersistent()


            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("updating descriptor " + configItem.getExternalID());
            }
            configItem.setLastAccess(new Date());
            configItem.computeDBHash();
            pm.makePersistent(descriptor);
            tx.commit();
        } catch (Throwable t) {
            // make sure its logged
            LOGGER.error(t);
            throw new RuntimeException(t);
View Full Code Here


      gaeFile.setLastModified(lastModified);
      gaeFile.setSegmentCount(segmentCount);
      gaeFile.setDeleted(false);

      // create persistence data
      pm.makePersistent(gaeFile);
    }
    pm.close();

    return gaeFile.getId();
  }
View Full Code Here

      GAEFileContent gaeContent = new GAEFileContent();
      gaeContent.setFileId(fileId);
      gaeContent.setSegmentNo(segmentNo);
      gaeContent.setSegmentLength(segmentLength);
      gaeContent.setContent(new Blob(content));
      pm.makePersistent(gaeContent);
    } else {
      GAEFileContent gaeContent = segments.get(0);
      gaeContent.setSegmentLength(segmentLength);
      gaeContent.setContent(new Blob(content));
    }
View Full Code Here

    if (categories.size() == 0) {
      GAEIndexCategory entity = new GAEIndexCategory();
      entity.setCat(category);
      entity.setVer(version);
      entity.setLastModified(lastModified);
      pm.makePersistent(entity);
    } else {
      GAEIndexCategory entity = categories.get(0);
      entity.setVer(version);
      entity.setLastModified(lastModified);
    }
View Full Code Here

                {
                    pm.getFetchPlan().addGroup( fetchGroups[i] );
                }
            }

            pm.makePersistent( object );

            object = pm.detachCopy( object );

            tx.commit();
View Full Code Here

      chapter.setLatitude(point.getLatitude());
      chapter.setLongitude(point.getLongitude());

      PersistenceManager pm = PMF.get().getPersistenceManager();
      try {
        pm.makePersistent(chapter);
      } catch (Exception e) {
        response.getWriter().println("Geocode update failed: JDO error");
        return;
      } finally {
        pm.close();
View Full Code Here

    try {
      location = pm.getObjectById(Location.class, key);

      if (location != null) {
        location.setOccurrences(location.getOccurrences() + 1);
        pm.makePersistent(location);
      }
    } catch (JDOObjectNotFoundException e) {
      location = new Location(key, latitude, longitude);
      pm.makePersistent(location);
    } finally {
View Full Code Here

        location.setOccurrences(location.getOccurrences() + 1);
        pm.makePersistent(location);
      }
    } catch (JDOObjectNotFoundException e) {
      location = new Location(key, latitude, longitude);
      pm.makePersistent(location);
    } finally {
      pm.close();
    }
  }
View Full Code Here

      Employee e = (Employee) XORM.newInstance(factory, Employee.class);
      e.setFirstName("J"+i);
      e.setLastName("Random"+i);
      e.setAddress(a);
     
      mgr.makePersistent(e);
  }
  mgr.currentTransaction().commit();
  mgr.close();
    }
View Full Code Here

     */
    public void testNewPersistentString() {
        PersistenceManager mgr = factory.getPersistenceManager();
        mgr.currentTransaction().begin();
        StringInterface si = (StringInterface) XORM.newInstance(mgr, StringInterface.class);
        mgr.makePersistent(si);
        mgr.currentTransaction().commit();

        // Now delete it
        mgr.currentTransaction().begin();
        mgr.deletePersistent(si);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.