Пример #1
0
 private void determineKeySelectExpressions(
     QueryableCollection collectionPersister, List selections) {
   AliasGenerator aliasGenerator = new LocalAliasGenerator(0);
   appendSelectExpressions(collectionPersister.getIndexColumnNames(), selections, aliasGenerator);
   Type keyType = collectionPersister.getIndexType();
   if (keyType.isAssociationType()) {
     EntityType entityType = (EntityType) keyType;
     Queryable keyEntityPersister =
         (Queryable) sfi().getEntityPersister(entityType.getAssociatedEntityName(sfi()));
     SelectFragment fragment =
         keyEntityPersister.propertySelectFragmentFragment(collectionTableAlias(), null, false);
     appendSelectExpressions(fragment, selections, aliasGenerator);
   }
 }
Пример #2
0
 private void determineValueSelectExpressions(
     QueryableCollection collectionPersister, List selections) {
   AliasGenerator aliasGenerator = new LocalAliasGenerator(1);
   appendSelectExpressions(
       collectionPersister.getElementColumnNames(), selections, aliasGenerator);
   Type valueType = collectionPersister.getElementType();
   if (valueType.isAssociationType()) {
     EntityType valueEntityType = (EntityType) valueType;
     Queryable valueEntityPersister =
         (Queryable) sfi().getEntityPersister(valueEntityType.getAssociatedEntityName(sfi()));
     SelectFragment fragment =
         valueEntityPersister.propertySelectFragmentFragment(elementTableAlias(), null, false);
     appendSelectExpressions(fragment, selections, aliasGenerator);
   }
 }