Package org.openqreg.bean

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


     
      CountryBean country1 = BeanFactory.getCountry("uz");
      country1.create(con);
     
      country1.setStatus(new Integer(Status.INACTIVE));
      country1.store(con);

      CountryBean country2 = (CountryBean) CountryFinderBase.findByPrimaryKey(con, new CountryKey(country1.getId()));
      assertEquals("Countryn skall vara lika", country1, country2);
      assertEquals("Countryn skall ha samma status", country1.getStatus(), country2.getStatus());
View Full Code Here


      assertEquals("Attributen skall vara lika", country1.getAttribute("name1"), country2.getAttribute("name1"));
     
      //Radera attribut
      country2.removeAttribute("name1");
      assertNull("Attributet skall inte finnas", country2.getAttribute("name1"));
      country2.store(con);
      country1 = (CountryBean)CountryFinderBase.findByPrimaryKey(con, new CountryKey(country2.getId()));
      assertNull("Attributet skall inte finnas", country2.getAttribute("name1"));

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

      country1.setAttribute("name1", "newvalue1");
      country1.store(con);
      country2 = (CountryBean)CountryFinderBase.findByPrimaryKey(con, new CountryKey(country1.getId()));
      assertEquals("Attributet skall ha nytt v�rde", "newvalue1", country2.getAttribute("name1"));
      country2.removeAllAttributes();
      country2.store(con);
     
      //Skapa tre attribut, d�refter uppdatera ett och radera ett
      assertTrue("Det skall inte finnas n�gra attribut", country2.getAttributes().isEmpty());
      country2.setAttribute("name1", "value1");
      country2.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", country2.getAttributes().isEmpty());
      country2.setAttribute("name1", "value1");
      country2.setAttribute("name2", "value2");
      country2.setAttribute("name3", "value3");
      country2.store(con);
     
      country2.setAttribute("name1", "newvalue1");
      country2.removeAttribute("name2");
      country2.setAttribute("name3", "");
      assertEquals("Det skall finnas tv� attribut", 2, country2.getAttributes().size());
View Full Code Here

     
      country2.setAttribute("name1", "newvalue1");
      country2.removeAttribute("name2");
      country2.setAttribute("name3", "");
      assertEquals("Det skall finnas tv� attribut", 2, country2.getAttributes().size());
      country2.store(con);
     
      country1 = (CountryBean)CountryFinderBase.findByPrimaryKey(con, new CountryKey(country2.getId()));
      assertEquals("Det skall finnas ett attribut", 1, country1.getAttributes().size());
      assertEquals("Fel attributv�rde", "newvalue1", country1.getAttribute("name1"));
      assertNull("Attributet skall inte finnas", country1.getAttribute("name2"));
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.