pnIndex,
pm.getMultithreaded(),
!isPolymorphic);
//if the class is polymorphic, register an intermediary prefetch buffer
if (isPolymorphic) {
IntermediaryPrefetchBuffer ipb = new IntermediaryPrefetchBufferImpl(
prefetchBuffer,
pcm.getIndexesTable(pcm));
if (!pcm.getPMapper().getPrefetchCache().registerPrefetchBuffer(
ipb, pcm, pm.currentTransaction())) {
throw new MedorException("No prefetch buffer registered for the pcm " + pcm.getClassName() + ".");
}
//register the prefetch buffer for all the subclasses
try{
//get the list of all the sub pclassmappings
PClassMapping[] subPCMs = pcm.getSubPCMs();
if (subPCMs != null) {
for (int i = 0; i < subPCMs.length; i++) {
//create an intermediary prefetchBuffer that has the prefetchBuffer
//of the superclass as delegate prefetch buffer
//and the association table for the pcm of the superclass
IntermediaryPrefetchBuffer intermediaryPb = new IntermediaryPrefetchBufferImpl(
prefetchBuffer,
subPCMs[i].getIndexesTable(pcm));
if (!subPCMs[i].getPMapper().getPrefetchCache().registerPrefetchBuffer(
intermediaryPb, subPCMs[i], pm.currentTransaction())) {
throw new MedorException("No prefetch buffer registered for the pcm " + subPCMs[i].getClassName() + ".");