Package org.objectweb.speedo.pobjects.userid

Examples of org.objectweb.speedo.pobjects.userid.IntervenantHelper


    public void testA() {
        try {
            PersistenceManager pm = pmf.getPersistenceManager();
            pm.currentTransaction().begin();
      for(int i=0; i<5; i++) {
        IntervenantHelper ih = new IntervenantHelper();
        ih.setNomep(i);
        ih.setConventions(new ArrayList());
        for(int j=0; j<i; j++) {
          ConventionHelper ch = new ConventionHelper();
          ch.setCdmec("cdmec" + i + "_" + j);
          ch.setCdmem("cdmem" + i + "_" + j);
          ch.setCdmed("cdmed" + i + "_" + j);
          ch.setNomep(i);
          ch.setIntervenant(ih);
          ch.setDdmec(Calendar.getInstance().getTime());
          ch.setCdmese("cdmese" + i + "_" + j);
          ih.getConventions().add(ch);
        }
        pm.makePersistent(ih);
      }
            pm.currentTransaction().commit();

      pm.evictAll(); //clear the L2 cache
     
            pm.currentTransaction().begin();
      IntervenantHelper ih = (IntervenantHelper) pm.getObjectById(
        pm.newObjectIdInstance(IntervenantHelper.class, "" + 2),
        false);
      assertEquals("Bad convention elements in collection",
        2,
        ih.getConventions().size());
            pm.close();
            deleteAllInstances(IntervenantHelper.class);
            deleteAllInstances(ConventionHelper.class);
        } catch (Exception e) {
            logger.log(BasicLevel.ERROR, "Exception", e);
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.pobjects.userid.IntervenantHelper

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.