Package org.objectweb.jorm.api

Examples of org.objectweb.jorm.api.PMapCluster


    PMapper mapper = getMapper(getPMF());
    PersistenceManager pm = getPMF().getPersistenceManager();
    for(int i=0; i<classNameToInit.length; i++) {
      pm.getObjectIdClass(Class.forName(classNameToInit[i]));
      if (clean) {
        PMapCluster pmc = mapper.getPMapCluster(classNameToInit[i]);
        assertNotNull("No PMapCluster for the class: " + classNameToInit[i], pmc);
        pmc.deleteData();
      }
    }
  }
View Full Code Here


    mapper.map(null, pcm);
    pcm.configureRefFields(new GCMHomeConfig(pcm));   
        cpm.applyProperties(pcm);
    logger.log(BasicLevel.DEBUG, "Class " + className + " mapped");
    //Manage the cluster of classes
    PMapCluster cluster = mapper.getPMappingStructuresManager().getPMapCluster(className);
    if (cluster.isDefined()) { //cluster is full (all classes are mapped)
      if (mappingStructuresRule >= CREATE_IF_REQUIRED) {
        if (mappingStructuresRule == FORCE_CREATE) {
          cluster.deleteMappingStructures();
        }
        cluster.createMappingStructures(
          mappingStructuresRule == FORCE_CREATE);
        if (mappingStructuresRule == DELETE_DATA) {
          cluster.deleteData();
        }
      }
      if (logger.isLoggable(BasicLevel.INFO)) {
          String msr=null;
          switch(mappingStructuresRule){
          case CREATE_IF_REQUIRED: msr = "CREATE_IF_REQUIRED"; break;
          case FORCE_CREATE: msr = "FORCE_CREATE"; break;
          case DELETE_DATA: msr = "DELETE_DATA"; break;
          case DO_NOTHING: msr = "DO_NOTHING"; break;
          }
        logger.log(BasicLevel.INFO, "Classes "
          + cluster.getClusterClasses()
          + " initialized (" + msr + ").");
      }
    } else { // some classes are not already mapped
      //ask the mapping of the next
      getPClassMapping((String) cluster
        .getUnResolvedDependencies().iterator().next(),
        classLoader);
    }
    return pcm;
  }
View Full Code Here

TOP

Related Classes of org.objectweb.jorm.api.PMapCluster

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.