public void fetch(QueryTranslatorImpl q, String entityName) throws QueryException { if (isCollectionValued()) { q.setCollectionToFetch( getCollectionRole(), getCollectionName(), getCollectionOwnerName(), entityName); } else { q.addEntityToFetch(entityName, getOneToOneOwnerName(), getOwnerAssociationType()); } }
void setCollectionToFetch(String role, String name, String ownerName, String entityName) throws QueryException { fetchName = name; collectionPersister = getCollectionPersister(role); collectionOwnerName = ownerName; if (collectionPersister.getElementType().isEntityType()) { addEntityToFetch(entityName); } }
void addEntityToFetch( String name, String oneToOneOwnerName, AssociationType ownerAssociationType) { addEntityToFetch(name); if (oneToOneOwnerName != null) oneToOneOwnerNames.put(name, oneToOneOwnerName); if (ownerAssociationType != null) uniqueKeyOwnerReferences.put(name, ownerAssociationType); }