private void renderJoin(Join join, JoinFragment joinFragment) { if ( CompositeQuerySpace.class.isInstance( join.getRightHandSide() ) ) { handleCompositeJoin( join, joinFragment ); } else if ( EntityQuerySpace.class.isInstance( join.getRightHandSide() ) ) { // do not render the entity join for a one-to-many association, since the collection join // already joins to the associated entity table (see doc in renderCollectionJoin()). if ( join.getLeftHandSide().getDisposition() == QuerySpace.Disposition.COLLECTION ) { if ( CollectionQuerySpace.class.cast( join.getLeftHandSide() ).getCollectionPersister().isManyToMany() ) { renderManyToManyJoin( join, joinFragment ); } else if ( JoinDefinedByMetadata.class.isInstance( join ) && CollectionPropertyNames.COLLECTION_INDICES.equals( JoinDefinedByMetadata.class.cast( join ).getJoinedPropertyName() ) ) { renderManyToManyJoin( join, joinFragment ); } } else { renderEntityJoin( join, joinFragment ); } } else if ( CollectionQuerySpace.class.isInstance( join.getRightHandSide() ) ) { renderCollectionJoin( join, joinFragment ); } }
.getSessionFactory(); if ( collectionType.getElementType( sessionFactory ).isEntityType() && !sessionFactory.getMetamodel().collectionPersister( collectionType.getRole() ).isManyToMany() ) { String entityName = collectionType.getAssociatedEntityName( sessionFactory ); String rootEntityName = action.getSession().getFactory().getMetamodel().entityPersister( entityName ).getRootEntityName();
if ( !collectionPersister.isManyToMany() && mappedBy != null && !mappedBy.isEmpty() ) { int i = persister.getEntityMetamodel().getPropertyIndex( mappedBy );
|| rightHandSide.getCollectionPersister().isManyToMany() ) {
if ( persister.isManyToMany() ) { manyToManyTableAlias = createTableAlias( persister.getRole() ); tableAlias = createTableAlias( persister.getElementDefinition().toEntityDefinition().getEntityPersister() );
@Override public boolean isManyToMany() { return joinable instanceof org.hibernate.persister.collection.CollectionPersister && ((org.hibernate.persister.collection.CollectionPersister) joinable).isManyToMany(); }
final Joinable joinableCollection = (Joinable) fetch.getCollectionPersister(); if ( fetch.getCollectionPersister().isManyToMany() ) {
CollectionPersister persister = sessionFactoryImplementor.getCollectionPersister( collection.getRole() ); if ( persister.isManyToMany() && collection.getType().isAssociationType() )
CollectionType collectionType = collectionPersister.getCollectionType(); if ( collectionPersister.isManyToMany() && collectionType.isAssociationType() )
property.setManyToMany( persister.isManyToMany() );