Package javax.jdo

Examples of javax.jdo.FetchPlan.addGroup()


    child2.setChildren(children2);
   
    PersistenceManager pm = pmf.getPersistenceManager();
    FetchPlan fp = pm.getFetchPlan();
    fp.clearGroups();
    fp.addGroup("detailChildren").removeGroup("default");
    pm.currentTransaction().begin();
    logger.log(BasicLevel.DEBUG, "make persistent the person " + parent.toString());
    pm.makePersistent(parent);
    pm.currentTransaction().commit();
    logger.log(BasicLevel.DEBUG, "FG: " + fp.getGroups());
View Full Code Here


    child2.setChildren(children2);
   
    PersistenceManager pm = pmf.getPersistenceManager();
    FetchPlan fp = pm.getFetchPlan();
    fp.clearGroups();
    fp.addGroup("detailChildren2").removeGroup("default");
    pm.currentTransaction().begin();
    logger.log(BasicLevel.DEBUG, "make persistent the person " + parent.toString());
    pm.makePersistent(parent);
    pm.currentTransaction().commit();
    logger.log(BasicLevel.DEBUG, "FG: " + fp.getGroups());
View Full Code Here

    child2.setChildren(children2);
   
    PersistenceManager pm = pmf.getPersistenceManager();
    FetchPlan fp = pm.getFetchPlan();
    fp.clearGroups();
    fp.addGroup("detailChildren3").removeGroup("default");
    pm.currentTransaction().begin();
    logger.log(BasicLevel.DEBUG, "make persistent the person " + parent.toString());
    pm.makePersistent(parent);
    pm.currentTransaction().commit();
    logger.log(BasicLevel.DEBUG, "FG: " + fp.getGroups());
View Full Code Here

    n2.addEdge(n5.getName(), new EdgeWeight(4));
   
    PersistenceManager pm = pmf.getPersistenceManager();
    FetchPlan fp = pm.getFetchPlan();
    fp.clearGroups();
    fp.addGroup("keyValue").removeGroup("default");
    pm.currentTransaction().begin();
    logger.log(BasicLevel.DEBUG, "make persistent the nodes " + n1.toString() + ", " + n2.toString()
        + ", " + n3.toString() + ", " + n4.toString() + ", " + n5.toString());
    pm.makePersistent(n1);
    pm.makePersistent(n2);
View Full Code Here

    n2.addEdge(n5.getName(), new EdgeWeight(4));
   
    PersistenceManager pm = pmf.getPersistenceManager();
    FetchPlan fp = pm.getFetchPlan();
    fp.clearGroups();
    fp.addGroup("keyOnly").removeGroup("default");
    pm.currentTransaction().begin();
    logger.log(BasicLevel.DEBUG, "make persistent the nodes " + n1.toString() + ", " + n2.toString()
        + ", " + n3.toString() + ", " + n4.toString() + ", " + n5.toString());
    pm.makePersistent(n1);
    pm.makePersistent(n2);
View Full Code Here

    children.add(child2);
    parent.setChildren(children);
   
    PersistenceManager pm = pmf.getPersistenceManager();
    FetchPlan fp = pm.getFetchPlan();
    fp.addGroup("all").removeGroup("default");
    pm.currentTransaction().begin();
    logger.log(BasicLevel.DEBUG, "make persistent the person " + parent.toString());
    pm.makePersistent(parent);
    pm.currentTransaction().commit();
   
View Full Code Here

     * Finally, that fetch group is removed from the fetch plan again.
     * @param query the query
     */
    private void checkFetchGroup2(Query query) {
        FetchPlan fetchplan = query.getFetchPlan();
        fetchplan.addGroup(FETCH_GROUP_2);
        Collection fetchgroups = fetchplan.getGroups();
        try {
            assertTrue("FetchPlan should include fetchGroup1 and fetchGroup2",
                       fetchgroups.contains(FETCH_GROUP_1) &&
                       fetchgroups.contains(FETCH_GROUP_2));
View Full Code Here

    public void testDetachCopyAccessFieldNotInFetchPlan() {
        // datastore transaction, retainValues=false
        getPM().currentTransaction().begin();
        FetchPlan fp = pm.getFetchPlan();
        // Product field not in Fetch Plan
        fp.addGroup(CART_ENTRIES);
        fp.addGroup(CARTENTRY_CART);

        CartEntry cartEntryDetached = (CartEntry)pm.detachCopy(cartEntry1);
        try {
            Product prod = cartEntryDetached.getProduct();
View Full Code Here

        // datastore transaction, retainValues=false
        getPM().currentTransaction().begin();
        FetchPlan fp = pm.getFetchPlan();
        // Product field not in Fetch Plan
        fp.addGroup(CART_ENTRIES);
        fp.addGroup(CARTENTRY_CART);

        CartEntry cartEntryDetached = (CartEntry)pm.detachCopy(cartEntry1);
        try {
            Product prod = cartEntryDetached.getProduct();
            fail("Expected exception on access of field not in fetch plan" +
View Full Code Here

    public void checkAddGroup() {
        Set expectedGroups = new HashSet();
        expectedGroups.add("default");
        expectedGroups.add("group1");
        FetchPlan fp = getPM().getFetchPlan();
        fp.addGroup("group1");
        Collection groups = fp.getGroups();
        if (!setEquals(expectedGroups, groups)) {
            failCompare(
                "checkAddGroup(): wrong getGroups() " +
                    "after addGroup.",
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.