Examples of Applicant


Examples of com.liferay.faces.demos.dto.Applicant

  private boolean resizable = true;

  @PostConstruct
  public void init() {

    applicant = new Applicant();

    if (ViewParamUtil.getUsage().equals("default-value")) {
      applicant.setComments(
        "<p>This is some <strong>bold</strong> text\nand this is some <em>italic</em> text.</p>");
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.query.domain.Applicant

  public void testUpdateSingleValuedAssociationToNonNullViaParameter() {
    Application pc = createApplicationWithNullApplicant();
    assertNull(pc.getUser());
   
    String jpql = "UPDATE Application a SET a.user = :user";
    Applicant newUser = createApplicant();
    updateByQuery(jpql, "user", newUser);
   
    assertUserNullity(!MUST_BE_NULL);
  }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.query.domain.Applicant

    em.getTransaction().begin();
        List<Application> result = em.createQuery(
                "SELECT a FROM Application a").getResultList();
    assertFalse(result.isEmpty());
    for (Application pc : result) {
      Applicant user = pc.getUser();
      if (shouldBeNull)
        assertNull(user);
      else
        assertNotNull(user);
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.query.domain.Applicant

 
  Application createApplicationWithNonNullApplicant() {
    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    Application app = new Application();
    Applicant user = new Applicant();
    user.setName("Non-Null User");
    app.setUser(user);
    em.persist(app);
    em.persist(user);
    em.getTransaction().commit();
    return app;
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.query.domain.Applicant

  }
 
  Applicant createApplicant() {
    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    Applicant user = new Applicant();
    user.setName("Non-Null User");
    em.persist(user);
    em.getTransaction().commit();
    return user;
  }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.query.domain.Applicant

  public void testUpdateSingleValuedAssociationToNonNullViaParameter() {
    Application pc = createApplicationWithNullApplicant();
    assertNull(pc.getUser());
   
    String jpql = "UPDATE Application a SET a.user = :user";
    Applicant newUser = createApplicant();
    updateByQuery(jpql, "user", newUser);
   
    assertUserNullity(!MUST_BE_NULL);
  }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.query.domain.Applicant

    em.getTransaction().begin();
    List<Application> result =
      em.createQuery("SELECT a FROM Application a").getResultList();
    assertFalse(result.isEmpty());
    for (Application pc : result) {
      Applicant user = pc.getUser();
      if (shouldBeNull)
        assertNull(user);
      else
        assertNotNull(user);
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.query.domain.Applicant

 
  Application createApplicationWithNonNullApplicant() {
    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    Application app = new Application();
    Applicant user = new Applicant();
    user.setName("Non-Null User");
    app.setUser(user);
    em.persist(app);
    em.persist(user);
    em.getTransaction().commit();
    return app;
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.query.domain.Applicant

  }
 
  Applicant createApplicant() {
    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    Applicant user = new Applicant();
    user.setName("Non-Null User");
    em.persist(user);
    em.getTransaction().commit();
    return user;
  }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.query.domain.Applicant

    public void testNoReturnNoParamProcedure() {
        if (procedureList != null) {
            EntityManager em = emf.createEntityManager();

            Applicant applicant1 = new Applicant();
            applicant1.setName("Charlie");
            Applicant applicant2 = new Applicant();
            applicant2.setName("Snoopy");

            em.getTransaction().begin();
            em.persist(applicant1);
            em.persist(applicant2);
            em.getTransaction().commit();

            String sql = procedureList.callAddXToCharlie();

            // query.getSingleResult() and query.getResultList() both throw an
            // exception:
            // Statement.executeQuery() cannot be called with a statement that
            // returns a row count
            try {
                em.getTransaction().begin();
                Query query = em.createNativeQuery(sql);
                query.getSingleResult();
                em.getTransaction().commit();
                fail("Expected exception. getSingleResult() with no returns " +
                    "should fail.");
            } catch (Exception e) {
                //Expected exception
                em.getTransaction().rollback();
            }
            try {
                em.getTransaction().begin();
                Query query = em.createNativeQuery(sql);
                query.getResultList();
                em.getTransaction().commit();
                fail("Expected exception. getResultList() with no returns " +
                    "should fail.");
            } catch (Exception e) {
                //Expected exception
                em.getTransaction().rollback();
            }

            // This one should work properly
            try {
                em.getTransaction().begin();
                Query query = em.createNativeQuery(sql);
                query.executeUpdate();
                em.getTransaction().commit();
            } catch (Exception e) {
                em.getTransaction().rollback();
                fail("Caught unexpected exception executing stored procedure: "
                    + e.getMessage());
            }

            // refresh the data
            em.clear();
            em.close();
            em = emf.createEntityManager();
            applicant1 = em.find(Applicant.class, applicant1.getId());
            applicant2 = em.find(Applicant.class, applicant2.getId());

            // verify one changed and one didn't
            assertEquals("Charliex", applicant1.getName());
            assertEquals("Snoopy", applicant2.getName());
       
            em.clear();
            em.close();
        }
    }
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.