Package org.openqreg.bean

Examples of org.openqreg.bean.CentreBean.store()


      assertEquals("Attributen skall vara lika", centre1.getAttribute("name1"), centre2.getAttribute("name1"));
     
      //Radera attribut
      centre2.removeAttribute("name1");
      assertNull("Attributet skall inte finnas", centre2.getAttribute("name1"));
      centre2.store(con);
      centre1 = (CentreBean)CentreFinderBase.findByPrimaryKey(con, new CentreKey(centre2.getId()));
      assertNull("Attributet skall inte finnas", centre2.getAttribute("name1"));

      //Uppdatera attribut
      centre1.setAttribute("name1", "value1");
View Full Code Here


      centre1.setAttribute("name1", "newvalue1");
      centre1.store(con);
      centre2 = (CentreBean)CentreFinderBase.findByPrimaryKey(con, new CentreKey(centre1.getId()));
      assertEquals("Attributet skall ha nytt v�rde", "newvalue1", centre2.getAttribute("name1"));
      centre2.removeAllAttributes();
      centre2.store(con);
     
      //Skapa tre attribut, d�refter uppdatera ett och radera ett
      assertTrue("Det skall inte finnas n�gra attribut", centre2.getAttributes().isEmpty());
      centre2.setAttribute("name1", "value1");
      centre2.setAttribute("name2", "value2");
View Full Code Here

      //Skapa tre attribut, d�refter uppdatera ett och radera ett
      assertTrue("Det skall inte finnas n�gra attribut", centre2.getAttributes().isEmpty());
      centre2.setAttribute("name1", "value1");
      centre2.setAttribute("name2", "value2");
      centre2.setAttribute("name3", "value3");
      centre2.store(con);
     
      centre2.setAttribute("name1", "newvalue1");
      centre2.removeAttribute("name2");
      centre2.setAttribute("name3", "");
      assertEquals("Det skall finnas tv� attribut", 2, centre2.getAttributes().size());
View Full Code Here

     
      centre2.setAttribute("name1", "newvalue1");
      centre2.removeAttribute("name2");
      centre2.setAttribute("name3", "");
      assertEquals("Det skall finnas tv� attribut", 2, centre2.getAttributes().size());
      centre2.store(con);
     
      centre1 = (CentreBean)CentreFinderBase.findByPrimaryKey(con, new CentreKey(centre2.getId()));
      assertEquals("Det skall finnas ett attribut", 1, centre1.getAttributes().size());
      assertEquals("Fel attributv�rde", "newvalue1", centre1.getAttribute("name1"));
      assertNull("Attributet skall inte finnas", centre1.getAttribute("name2"));
View Full Code Here

      CentreBean centre1 = BeanFactory.getCentre(Thread.currentThread().getId());
      Connection con = DbHandler.getConnection();
      con.setAutoCommit(false);
      centre1.create(con);
      centre1.setStatus(new Integer(Status.INACTIVE));
      centre1.store(con);

      CentreBean centre2 = (CentreBean) CentreFinderBase.findByPrimaryKey(con, new CentreKey(centre1.getId()));
      assertEquals("Centren skall vara lika", centre1, centre2);
      assertEquals("Centren skall ha samma status", centre1.getStatus(), centre2.getStatus());
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.