Examples of persist()


Examples of org.apache.openjpa.persistence.EntityManagerImpl.persist()

            CachedEntityStatistics e = new CachedEntityStatistics();
            CachedEntityStatistics lazy = new CachedEntityStatistics();
            Set<CachedEntityStatistics> lazyList = new HashSet<CachedEntityStatistics>();
            lazyList.add(lazy);
            e.setLazyList(lazyList);
            em.persist(e);
            em.persist(lazy);
            em.flush();
            em.clear();

            // Should prime the cache
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.persist()

    public void testAccessIdBeforeCommit() {
        OpenJPAEntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        UnenhancedIdentityIdPropertyAccess o =
            new UnenhancedIdentityIdPropertyAccess();
        em.persist(o);
        em.getObjectId(o);
        em.getTransaction().commit();
        em.close();
    }
}
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManagerSPI.persist()

            // expected
        }
        OpenJPAEntityManagerSPI em = emf.createEntityManager();
        em.getTransaction().begin();
        AllFieldTypes type = new AllFieldTypes();
        em.persist(type);
        em.getTransaction().commit();
        Object oid = em.getObjectId(type);
        assertEquals(Id.class, JPAFacadeHelper.toOpenJPAObjectId(cmd, oid).getClass());
    }
}
View Full Code Here

Examples of org.apache.slider.core.build.InstanceBuilder.persist()

      log.debug("Error validating application instance definition ", e);
      log.info(instanceDefinition.toString());
      throw e;
    }
    try {
      builder.persist(appconfdir);
    } catch (LockAcquireFailedException e) {
      log.warn("Failed to get a Lock on {} : {}", builder, e);
      throw new BadClusterStateException("Failed to save " + clustername
                                         + ": " + e);
    }
View Full Code Here

Examples of org.apache.solr.core.CoreContainer.persist()

      }
    } // switch
     
    // Should we persist the changes?
    if (do_persist) {
      cores.persist();
      rsp.add("saved", cores.getConfigFile().getAbsolutePath());
    }
  }
 
  private static NamedList<Object> getCoreStatus(CoreContainer cores, String cname ) throws IOException
View Full Code Here

Examples of org.apache.spark.api.java.JavaDoubleRDD.persist()

  @SuppressWarnings("unchecked")
  @Test
  public void persist() {
    JavaDoubleRDD doubleRDD = sc.parallelizeDoubles(Arrays.asList(1.0, 1.0, 2.0, 3.0, 5.0, 8.0));
    doubleRDD = doubleRDD.persist(StorageLevel.DISK_ONLY());
    Assert.assertEquals(20, doubleRDD.sum(), 0.1);

    List<Tuple2<Integer, String>> pairs = Arrays.asList(
      new Tuple2<Integer, String>(1, "a"),
      new Tuple2<Integer, String>(2, "aa"),
View Full Code Here

Examples of org.chromattic.api.ChromatticSession.persist()

      try
      {
         ProducerInfosMapping pims = getProducerInfosMapping(session);
         ProducerInfoMapping pim = pims.createProducerInfo(info.getId());
         String key = session.persist(pims, pim, info.getId());
         info.setKey(key);
         pim.initFrom(info);

         persister.closeSession(session, true);
      }
View Full Code Here

Examples of org.drools.persistence.PersistenceContext.persist()

    public void internalExecuteWorkItem(WorkItem workItem) {
        Environment env = this.kruntime.getEnvironment();
        WorkItemInfo workItemInfo = new WorkItemInfo(workItem, env);
       
        PersistenceContext context = ((PersistenceContextManager) env.get( EnvironmentName.PERSISTENCE_CONTEXT_MANAGER )).getCommandScopedPersistenceContext();
        workItemInfo = context.persist( workItemInfo );
       
        ((WorkItemImpl) workItem).setId(workItemInfo.getId());
        workItemInfo.transform();
       
        if (this.workItems == null) {
View Full Code Here

Examples of org.glassfish.api.admin.progress.JobPersistence.persist()

            else  {
                jobPersistenceService = Globals.getDefaultHabitat().getService(JobPersistenceService.class);
            }

            List<String> userList =  SubjectUtil.getUsernamesFromSubject(subject);
            jobPersistenceService.persist(new JobInfo(id,commandName,executionDate,report.getActionExitCode().name(),userList.get(0),report.getMessage(),getJobsFile(),State.COMPLETED.name(),completionDate));
        }
        complete(report);
    }

    @Override
View Full Code Here

Examples of org.glassfish.security.common.FileRealmHelper.persist()

                String[] groups = helper.authenticate(programOpts.getUser(), password.toCharArray());
                if (groups == null) {
                    throw new CommandException(strings.get("InvalidCredentials", programOpts.getUser()));
                }
                helper.updateUser(programOpts.getUser(), programOpts.getUser(), newpassword.toCharArray(), null);
                helper.persist();
                return SUCCESS;

            } else {
                //Cannot change password locally for non file realms
                throw new CommandException(strings.get("NotFileRealmCannotChangeLocally"));
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.