Package org.jpa

Examples of org.jpa.Orar


  }
  public Orar initTest2() {
    int idObiectTest=3;
    String intervalOrarTest="12-14";
    int salaCursTest=3;
    Orar o=new Orar();
    o.setData(new Date());
    o.setIdObiect(idObiectTest);
    o.setIntervalOrar(intervalOrarTest);
    o.setSalaCurs(salaCursTest);
    return o;
   
  }
View Full Code Here


  }
  @Test
  public void testOrarRelation(){
    String numeGrupaTest = "GrupaTest";
    Grupa g = new Grupa();
    Orar o = new Orar();

    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    o=initTest2();
    g.setNumeGrupa(numeGrupaTest);
   
    em.persist(g);
      o.setIdGrupa(g.getIdGrupa());
      g.getOrar().add(o);
      em.persist(g);
      em.getTransaction().commit();
    Query q = em.createQuery("select grT from Grupa grT ");
    Grupa grT1=new Grupa();
    grT1=(Grupa) q.getSingleResult();
    assertTrue("Nu a fost introdus in grupa","GrupaTest".equals(grT1.getNumeGrupa()));
     q = em.createQuery("select oT from Orar oT where oT.intervalOrar='12-14' ");
     Orar oT = new Orar();
     oT=(Orar) q.getSingleResult();
     assertTrue("Nu a fost introdus in orar","12-14".equals(oT.getIntervalOrar()));
     em.close();
  }
View Full Code Here

TOP

Related Classes of org.jpa.Orar

Copyright © 2018 www.massapicom. 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.