AbstractCollectionPersister.generateSelectSizeString() should use org.hibernate.sql.Select instead of org.hibernate.sql.SimpleSelect. Select allows providing an alias.