Package com.force.sdk.jpa.entities

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


public class JPAMappingTest extends BaseJPAFTest {
   
    @Test
    public void testTwoPojosMappedToOneEntity() {
        try {
            AccountMapped2ndTime acc = new AccountMapped2ndTime();
            acc.setName("account0");
            EntityTransaction tx = em.getTransaction();
            tx.begin();
            em.persist(acc);
            tx.commit();
            List<AccountMapped2ndTime> results =
                em.createQuery("select o from Account o where name='account0'", AccountMapped2ndTime.class).getResultList();
            Assert.assertEquals(results.size(), 1, "unexpected number of results returned in query");
            Assert.assertEquals(results.get(0).getId(), acc.getId(), "unexpected id in returned entity");
        } finally {
           em.createQuery("delete from Account o where o.name='account0'").executeUpdate();
        }
    }
View Full Code Here

TOP

Related Classes of com.force.sdk.jpa.entities.AccountMapped2ndTime

Copyright © 2018 www.massapicom. 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.