Examples of PersonEntity


Examples of com.force.sdk.jpa.entities.PersonEntity

    /* From spec:
     * If X is a new entity instance, a new managed entity instance X' is created
     * and the state of X is copied into the new managed entity instance X'.
     */
    public void testMergeAsPersist() {
        PersonEntity personEntity = new PersonEntity();
        personEntity.setName("acct 1");
       
        EntityTransaction tx = em.getTransaction();
        tx.begin();
        em.merge(personEntity);
        tx.commit();
         
        Assert.assertTrue(personEntity.getId() != null, "Id is null. Account object was not persisted by merge().");
       
        PersonEntity a1 = em.find(PersonEntity.class, personEntity.getId());
        Assert.assertEquals(a1.getName(), personEntity.getName(), "name was not persisted by merge().");
       
        // verify that two objects are different.
        Assert.assertNotSame(a1, personEntity, "New object was not created by merge().");
    }
View Full Code Here

Examples of com.force.sdk.jpa.entities.PersonEntity

        Assert.assertNotSame(a1, personEntity, "New object was not created by merge().");
    }
   
    @Test
    public void testMergeInSeparateTx() {
        PersonEntity personEntity = new PersonEntity();
        personEntity.setName("testMergeInSeparateTx");
       
        EntityTransaction tx = em.getTransaction();
        tx.begin();
        em.persist(personEntity);
        tx.commit();
       
        String persistPersonEntityId = personEntity.getId();
        personEntity.setName("testMergeInSeparateTxUpdate");
       
        tx = em.getTransaction();
        tx.begin();
        em.merge(personEntity);
        tx.commit();
       
        Assert.assertEquals(personEntity.getId(), persistPersonEntityId,
                                "Created new entity in separate transaction merge.");
    }
View Full Code Here

Examples of groundTruthModule.datastructure.PersonEntity

    }
  }

  private void generatePeople() {
    for (int i = 0; i < nPeople; i++) {
      db.addPerson(new PersonEntity(i));
    }
  }
View Full Code Here

Examples of groundTruthModule.datastructure.PersonEntity

   */
  public void associateOrganizations() {
    // create nPeople / 2 memberOf associations
    for (int i = 0; i < nPeople / 2; i++) {
      int rand1 = getRandom(0, nPeople - 1);
      PersonEntity person = db.getPeople().get(rand1);
      int rand2 = getRandom(0, nOrganizations - 1);
      OrganizationEntity organization = db.getOrganizations().get(rand2);
      while (organization.getMembers().contains(person)) {
        rand1 = getRandom(0, nPeople - 1);
        person = db.getPeople().get(rand1);
      }
      organization.addMember(person);
      person.addRelatedOrganization(organization);
    }
  }
View Full Code Here

Examples of org.postgis.ejb.PersonEntity

        String name = m.getString(IngestMDB.NAME);
        String surname = m.getString(IngestMDB.SURNAME);
        Double lat = m.getDouble(IngestMDB.LATITUDE);
        Double lon = m.getDouble(IngestMDB.LONGITUDE);
       
        PersonEntity person = new PersonEntity();
        person.setName(name);
        person.setSurname(surname);
        person.setLocation(new Point(lon, lat));
        person.setDate(new Date());
        entityManager.persist(person);
       
        // for tutorial info
        System.out.println("INGESTED " + name + " " + surname + " into PostGIS");
      } catch (JMSException e) {
View Full Code Here

Examples of org.socialmusicdiscovery.server.business.model.core.PersonEntity

    public PersonEntity create(PersonEntity person) {
        try {
            transactionManager.begin();
            person.setLastUpdated(new Date());
            person.setLastUpdatedBy(super.CHANGED_BY);
            PersonEntity createdEntity = super.createEntity(person);
            getRepository().refresh(createdEntity);
            return new CopyHelper().copy(createdEntity, Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
View Full Code Here

Examples of org.socialmusicdiscovery.server.business.model.core.PersonEntity

    public PersonEntity update(@PathParam("id") String id, PersonEntity person) {
        try {
            transactionManager.begin();
            person.setLastUpdated(new Date());
            person.setLastUpdatedBy(super.CHANGED_BY);
            PersonEntity updatedEntity = super.updateEntity(id, person);
            getRepository().refresh(updatedEntity);
            return new CopyHelper().copy(updatedEntity, Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
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.