Package models.orphans.collections

Examples of models.orphans.collections.BaseModel.save()


        levelTwo.levelOne = levelOne;

        levelOne.levelTwos.add(levelTwo);

        base.levelOnes.add(levelOne);
        base.save();
       
        renderText(base.id);
    }

    public static void update(Long id) {
View Full Code Here


    }

    public static void update(Long id) {
        BaseModel base = BaseModel.findById(id);
        base.levelOnes.remove(0);
        base.save();
    }

}
View Full Code Here

  LevelOne levelOneB = new LevelOne();
  levelOneB.baseModel = bmB;
  bmB.levelOnes.add(levelOneB);

  bmA.save();
  bmB.save();
 
  assertEquals("We must have 2 LevelOne", 2L, LevelOne.count("baseModel = ?1 OR baseModel = ?2", bmA, bmB));

  // now clear them out
  bmA.levelOnes.clear();
View Full Code Here

  // now clear them out
  bmA.levelOnes.clear();
  bmB.levelOnes.clear();

  bmA.save();
  bmB.save();
 
  assertEquals("We must have 0 LevelOne", 0L, LevelOne.count("baseModel = ?1 OR baseModel = ?2", bmA, bmB));

  // now add new ones
  levelOneA = new LevelOne();
View Full Code Here

 
  levelOneB = new LevelOne();
  levelOneB.baseModel = bmB;
  bmB.levelOnes.add(levelOneB);

  bmB.save();
  assertEquals("We must have 2 LevelOne", 2L, LevelOne.count("baseModel = ?1 OR baseModel = ?2", bmA, bmB));
    }
   
    @Ignore("wait for full fix")
    @Test
View Full Code Here

  LevelOne levelOneB = new LevelOne();
  levelOneB.baseModel = bmB;
  bmB.levelOnes.add(levelOneB);

  bmA.save();
  bmB.save();
 
  assertEquals("We must have 2 LevelOne", 2L, LevelOne.count("baseModel = ?1 OR baseModel = ?2", bmA, bmB));

  // now clear them out
  bmA.levelOnes.clear();
View Full Code Here

  // now clear them out
  bmA.levelOnes.clear();
  bmB.levelOnes.clear();

  bmA.save();
  bmB.save();
 
  assertEquals("We must have 0 LevelOne", 0L, LevelOne.count("baseModel = ?1 OR baseModel = ?2", bmA, bmB));

  // now add new ones
  levelOneA = new LevelOne();
View Full Code Here

  levelOneB = new LevelOne();
  levelOneB.baseModel = bmB;
  bmB.levelOnes.add(levelOneB);

  bmA.save();
  bmB.save();
  assertEquals("We must have 2 LevelOne", 2L, LevelOne.count("baseModel = ?1 OR baseModel = ?2", bmA, bmB));
    }
   
    @Test
    public void testCollectionOwnerError() {
View Full Code Here

    }
   
    @Test
    public void testCollectionOwnerError() {
  BaseModel bmA = new BaseModel();
  bmA.save();
  commitAndClear();

  bmA = BaseModel.findById(bmA.id);

  LevelOne levelOneA = new LevelOne();
View Full Code Here

  LevelOne levelOneB = new LevelOne();
  levelOneB.baseModel = bmA;
  bmA.levelOnes.add(levelOneB);

  bmA.save();
  commitAndClear();

  bmA = BaseModel.findById(bmA.id);

  LevelOne removed = bmA.levelOnes.remove(0);
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.