public List load(EntityInfo entityInfos) {
List results = new ArrayList( entityInfos.length );
if ( entityInfos.length == 0 ) return results;
initThisProjectionFlag( entityInfos[0] );
if ( projectThis ) {
objectLoader.load( entityInfos ); //load by batch
for (EntityInfo entityInfo : entityInfos) {
for (int index : entityInfo.indexesOfThis) {
//set one by one to avoid loosing null objects (skipped in the objectLoader.load( EntityInfo[] ))
entityInfo.projection[index] = objectLoader.load( entityInfo );
}
}
}
for (EntityInfo entityInfo : entityInfos) {
if ( transformer != null) {
results.add( transformer.transformTuple( entityInfo.projection, aliases ) );
}
else {
results.add( entityInfo.projection );
}
}
return results;
}
|