Package org.openqreg.bean

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


    try {
      con = DbHandler.getConnection();
      con.setAutoCommit(false);
      long id = Thread.currentThread().getId();
      CentreBean centre = BeanFactory.getCentre(id);
      centre.create(con);
     
      UserBean user = BeanFactory.getUser(id);
      user.setCentreid(centre.getId());
      user.create(con);
     
View Full Code Here


      con.setAutoCommit(false);

      //Spara och ladda attribut
      CentreBean centre1 = BeanFactory.getCentre(Thread.currentThread().getId());
      centre1.setAttribute("name1", "value1");
      centre1.create(con);
      CentreBean centre2 = (CentreBean)CentreFinderBase.findByPrimaryKey(con, new CentreKey(centre1.getId()));
      assertEquals("Centrena skall vara lika", centre1, centre2);
      assertEquals("Attributen skall vara lika", centre1.getAttribute("name1"), centre2.getAttribute("name1"));
     
      //Radera attribut
View Full Code Here

  public void testPersistance() {
    try {
      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);
View Full Code Here

      con = DbHandler.getConnection();
      con.setAutoCommit(false);
     
      CentreBean centre1 = BeanFactory.getCentre(Thread.currentThread().getId());
      centre1.setCentrename(centrename+"12345");
      centre1.create(con);
     
      CentreBean centre2 = BeanFactory.getCentre(Thread.currentThread().getId());
      centre2.setCentrename(centrename+"1234");
      centre2.create(con);
     
View Full Code Here

      centre1.setCentrename(centrename+"12345");
      centre1.create(con);
     
      CentreBean centre2 = BeanFactory.getCentre(Thread.currentThread().getId());
      centre2.setCentrename(centrename+"1234");
      centre2.create(con);
     
      CentreBean centre3 = BeanFactory.getCentre(Thread.currentThread().getId());
      centre3.setCentrename(centrename+"123");
      centre3.create(con);
      con.rollback();
View Full Code Here

      centre2.setCentrename(centrename+"1234");
      centre2.create(con);
     
      CentreBean centre3 = BeanFactory.getCentre(Thread.currentThread().getId());
      centre3.setCentrename(centrename+"123");
      centre3.create(con);
      con.rollback();
      con.close();
     
    } catch (SQLException sqle) {
      fail("SQLException on findLikeCentreName: " + sqle.getMessage());
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.