Пример #1
0
  @Override
  public List load(EntityInfo... entityInfos) {
    // no need to timeouManage here, the underlying loader is the real time consumer
    List results = new ArrayList(entityInfos.length);
    if (entityInfos.length == 0) {
      return results;
    }

    if (projectionEnabledOnThis(entityInfos[0])) {
      Loader objectLoader = getObjectLoader();
      objectLoader.load(entityInfos); // load by batch
      for (EntityInfo entityInfo : entityInfos) {
        final Object entityInstance = objectLoader.loadWithoutTiming(entityInfo);
        entityInfo.populateWithEntityInstance(entityInstance);
      }
    }
    for (EntityInfo entityInfo : entityInfos) {
      if (transformer != null) {
        results.add(transformer.transformTuple(entityInfo.getProjection(), aliases));
      } else {
        results.add(entityInfo.getProjection());
      }
    }

    return results;
  }
Пример #2
0
 @Override
 public Object load(EntityInfo entityInfo) {
   // no need to timeouManage here, the underlying loader is the real time consumer
   if (projectionEnabledOnThis(entityInfo)) {
     Loader objectLoader = getObjectLoader();
     final Object entityInstance = objectLoader.load(entityInfo);
     entityInfo.populateWithEntityInstance(entityInstance);
   }
   if (transformer != null) {
     return transformer.transformTuple(entityInfo.getProjection(), aliases);
   } else {
     return entityInfo.getProjection();
   }
 }