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;
}