Re: Weird behavior (M5)

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Aug 19 2005 - 17:13:28 EDT

  • Next message: Nick Stuart: "Re: Weird behavior (M5)"

    No idea what's wrong, as the code example that you posted uses your
    own methods to setup relationships. Also it is not clear whether
    template.getBlocks() and page.getBlocks() are generated methods for
    mapped relationships or methods with custom logic (?)

    I guess the easiest way to detect what's wrong is to run this block
    of code in debugger and step through the suspect methods.

    Andrus

    On Aug 19, 2005, at 8:52 PM, Nick Stuart wrote:

    > Hi all, playing around with Release M5 and am having a weird problem
    > with some toMany relationships.
    >
    > Here's the test code:
    > template = tf.create("TestPageTemplate", false, ctx);
    > assertNotNull(template);
    > tf.addBlock(template, "Block1PageCreate", ctx);
    > tf.addBlock(template, "Block2PageCreate", ctx);
    > //assertEquals(2, template.getBlocks().size());
    >
    > CmsPage page = pf.create(template, name, description, ctx);
    > assertNotNull(page);
    > assertEquals(name, page.getName());
    > assertEquals(description, page.getDescription());
    > assertEquals(template, page.getTemplate());
    > System.out.println("****** " + template.getBlocks().size() + "
    > -- " + page.getBlocks().size());
    >
    > Now if I leave the first assertEquals(2,...) commented out I get a
    > print out of ******* 4 --- 4. Hmmm...interesting. BUT if I uncomment
    > the first assert I get a print out showing 2 -- 2 as I would expected!
    > Whats up with that? The database only shows that the 2 template blocks
    > have been created, but 4 show up in the list, and 4 show up in the
    > page blocks! Doh!
    >
    > I believe I'm adding stuff correctly to the ctx/objects/whatever as
    > its all showing up and acts correctly with that assert
    > uncommented....any ideas?
    >
    > -Nick
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Aug 19 2005 - 17:13:31 EDT