Examples of clearFetchGroups()


Examples of org.apache.openjpa.persistence.FetchPlan.clearFetchGroups()

        fetch.removeFetchGroup("baz");
        fetch.removeFetchGroup("c");
        checkGroups(pm, new String[]{ "foo", "a", "b", "d" });

        fetch.clearFetchGroups().addFetchGroup(FetchPlan.GROUP_DEFAULT);
        checkGroups(pm, new String[0]);
    }

    private void checkGroups(OpenJPAEntityManager pm, String[] groups) {
        HashSet groupSet = new HashSet(Arrays.asList(groups));
View Full Code Here

Examples of org.apache.openjpa.persistence.FetchPlan.clearFetchGroups()

  public void testFetchBySubClassFieldB() {
    OpenJPAEntityManager em = emf.createEntityManager();
    FetchPlan fp = em.getFetchPlan();
    fp.setExtendedPathLookup(true);
    fp.clearFetchGroups().removeFetchGroup(FetchGroup.NAME_DEFAULT);
    fp.clearFields();
    fp.addField(FetchA.class, "b");
    fp.addField(FetchB.class, "text");

    FetchA a = (FetchA) em.createQuery(JPQL).getSingleResult();
View Full Code Here

Examples of org.apache.openjpa.persistence.FetchPlan.clearFetchGroups()

  public void testFetchBySubClassFieldA() {
    OpenJPAEntityManager em = emf.createEntityManager();
    FetchPlan fp = em.getFetchPlan();
        fp.setExtendedPathLookup(true);
    fp.clearFetchGroups().removeFetchGroup(FetchGroup.NAME_DEFAULT);
    fp.clearFields();
    fp.addField(FetchA.class, "b");
    fp.addField(FetchA.class, "text");

    FetchA a = (FetchA) em.createQuery(JPQL).getSingleResult();
View Full Code Here

Examples of org.apache.openjpa.persistence.FetchPlan.clearFetchGroups()

 
  public void testFetchBySuperClassField() {
    OpenJPAEntityManager em = emf.createEntityManager();
    FetchPlan fp = em.getFetchPlan();
        fp.setExtendedPathLookup(true);
    fp.clearFetchGroups().removeFetchGroup(FetchGroup.NAME_DEFAULT);
    fp.clearFields();
    fp.addField(FetchA.class, "b");
    fp.addField(FetchBase.class, "text");

    FetchA a = (FetchA) em.createQuery(JPQL).getSingleResult();
View Full Code Here

Examples of org.apache.openjpa.persistence.FetchPlan.clearFetchGroups()

 
  public void testFetchBySubClassFieldNameB() {
    OpenJPAEntityManager em = emf.createEntityManager();
    FetchPlan fp = em.getFetchPlan();
        fp.setExtendedPathLookup(true);
    fp.clearFetchGroups().removeFetchGroup(FetchGroup.NAME_DEFAULT);
    fp.clearFields();
    fp.addField(FetchA.class.getName() + ".b");
    fp.addField(FetchB.class.getName() + ".text");

    FetchA a = (FetchA) em.createQuery(JPQL).getSingleResult();
View Full Code Here

Examples of org.apache.openjpa.persistence.FetchPlan.clearFetchGroups()

  public void testFetchBySubClassFieldNameA() {
    OpenJPAEntityManager em = emf.createEntityManager();
    FetchPlan fp = em.getFetchPlan();
        fp.setExtendedPathLookup(true);
    fp.clearFetchGroups().removeFetchGroup(FetchGroup.NAME_DEFAULT);
    fp.clearFields();
    fp.addField(FetchA.class.getName() + ".b");
    fp.addField(FetchA.class.getName() + ".text");

    FetchA a = (FetchA) em.createQuery(JPQL).getSingleResult();
View Full Code Here

Examples of org.apache.openjpa.persistence.FetchPlan.clearFetchGroups()

 
  public void testFetchBySuperClassFieldName() {
    OpenJPAEntityManager em = emf.createEntityManager();
    FetchPlan fp = em.getFetchPlan();
        fp.setExtendedPathLookup(true);
    fp.clearFetchGroups().removeFetchGroup(FetchGroup.NAME_DEFAULT);
    fp.clearFields();
    fp.addField(FetchA.class.getName() + ".b");
    fp.addField(FetchBase.class.getName() + ".text");

    FetchA a = (FetchA) em.createQuery(JPQL).getSingleResult();
View Full Code Here

Examples of org.apache.openjpa.persistence.FetchPlan.clearFetchGroups()

      Collection<String> fetchGroups = fp.getFetchGroups();
      assertNotNull(fetchGroups);
      assertTrue(fetchGroups.contains(FetchGroup.NAME_DEFAULT));

      // Clear all active FetchGroups, only "default" should remain.
      fp.clearFetchGroups();
      Collection<String> fetchGroupsAfterClear = fp.getFetchGroups();
      assertNotNull(fetchGroupsAfterClear);
      assertTrue(fetchGroupsAfterClear.contains(FetchGroup.NAME_DEFAULT));   

      // Should still be able to remove the "default" FetchGroup
View Full Code Here

Examples of org.apache.openjpa.persistence.FetchPlan.clearFetchGroups()

        FetchConfiguration fetchCfg = ((org.apache.openjpa.persistence.EntityManagerImpl) em)
                .getBroker()
                .getFetchConfiguration();
        assertTrue(fetchCfg.isDefaultPUFetchGroupConfigurationOnly());
       
        fp.clearFetchGroups(); // OPENJPA-2413: now places "default" in the list of active fetch groups.
        assertNotNull(fp.getFetchGroups());
        assertEquals(1, fp.getFetchGroups().size());
        assertTrue(fp.getFetchGroups().contains("default"));
        assertFalse(fetchCfg.isDefaultPUFetchGroupConfigurationOnly());
       
View Full Code Here

Examples of org.apache.openjpa.persistence.FetchPlan.clearFetchGroups()

            assertEquals(mgr.getDescription(), findMgr.getDescription()); // Should not be lazy-loaded
        }
       
        // Clear all fetch groups, and verify expected behavior
        // OPENJPA-2413: now places "default" in the list of active fetch groups.
        fp.clearFetchGroups();
        assertNotNull(fp.getFetchGroups());
        assertEquals(1, fp.getFetchGroups().size());
        assertTrue(fp.getFetchGroups().contains("default"));
        assertFalse(fp.getFetchGroups().contains("DescFetchGroup"));
        assertFalse(fetchCfg.isDefaultPUFetchGroupConfigurationOnly());
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.