Package org.hibernate.persister.walking.spi

Examples of org.hibernate.persister.walking.spi.AssociationKey


            int columnPosition = currentColumnPosition;
            currentColumnPosition += type.getColumnSpan( sessionFactory() );

            if ( type.isAssociationType() ) {
              // we build the association-key here because of the "goofiness" with 'currentColumnPosition'
              final AssociationKey associationKey;
              final AssociationType aType = (AssociationType) type;
              final Joinable joinable = aType.getAssociatedJoinable( sessionFactory() );
              if ( aType.getForeignKeyDirection() == ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT ) {
                associationKey = new AssociationKey(
                    getLHSTableName(
                        aType,
                        attributeNumber(),
                        (OuterJoinLoadable) locateOwningPersister()
                    ),
                    getLHSColumnNames(
                        aType,
                        attributeNumber(),
                        columnPosition,
                        (OuterJoinLoadable) locateOwningPersister(),
                        sessionFactory()
                    )
                );
              }
              else {
                associationKey = new AssociationKey(
                    joinable.getTableName(),
                    getRHSColumnNames( aType, sessionFactory() )
                );
              }
View Full Code Here


    pushToStack( entityReturn );

    // also add an AssociationKey for the root so we can later on recognize circular references back to the root.
    final Joinable entityPersister = (Joinable) entityDefinition.getEntityPersister();
    associationKeyRegistered(
        new AssociationKey( entityPersister.getTableName(), entityPersister.getKeyColumnNames() )
    );
  }
View Full Code Here

    final CollectionReturn collectionReturn = new CollectionReturnImpl( collectionDefinition, querySpaces );
    pushToCollectionStack( collectionReturn );
    addRootReturn( collectionReturn );

    associationKeyRegistered(
        new AssociationKey(
            ( (Joinable) collectionDefinition.getCollectionPersister() ).getTableName(),
            ( (Joinable) collectionDefinition.getCollectionPersister() ).getKeyColumnNames()
        )
    );
  }
View Full Code Here

    final FetchStrategy fetchStrategy = determineFetchStrategy( attributeDefinition );
    if ( fetchStrategy.getStyle() != FetchStyle.JOIN ) {
      return; // nothing to do
    }

    final AssociationKey associationKey = attributeDefinition.getAssociationKey();

    // go ahead and build the bidirectional fetch
    if ( attributeDefinition.getAssociationNature() == AssociationAttributeDefinition.AssociationNature.ENTITY ) {
      final Joinable currentEntityPersister = (Joinable) currentSource().resolveEntityReference().getEntityPersister();
      final AssociationKey currentEntityReferenceAssociationKey =
          new AssociationKey( currentEntityPersister.getTableName(), currentEntityPersister.getKeyColumnNames() );
      // if associationKey is equal to currentEntityReferenceAssociationKey
      // that means that the current EntityPersister has a single primary key attribute
      // (i.e., derived attribute) which is mapped by attributeDefinition.
      // This is not a bidirectional association.
      // TODO: AFAICT, to avoid an overflow, the associated entity must already be loaded into the session, or
View Full Code Here

    pushToStack( entityReturn );

    // also add an AssociationKey for the root so we can later on recognize circular references back to the root.
    final Joinable entityPersister = (Joinable) entityDefinition.getEntityPersister();
    associationKeyRegistered(
        new AssociationKey( entityPersister.getTableName(), entityPersister.getKeyColumnNames() )
    );
  }
View Full Code Here

    final CollectionReturn collectionReturn = new CollectionReturnImpl( collectionDefinition, querySpaces );
    pushToCollectionStack( collectionReturn );
    addRootReturn( collectionReturn );

    associationKeyRegistered(
        new AssociationKey(
            ( (Joinable) collectionDefinition.getCollectionPersister() ).getTableName(),
            ( (Joinable) collectionDefinition.getCollectionPersister() ).getKeyColumnNames()
        )
    );
  }
View Full Code Here

    final FetchStrategy fetchStrategy = determineFetchStrategy( attributeDefinition );
    if ( fetchStrategy.getStyle() != FetchStyle.JOIN ) {
      return; // nothing to do
    }

    final AssociationKey associationKey = attributeDefinition.getAssociationKey();

    // go ahead and build the bidirectional fetch
    if ( attributeDefinition.getAssociationNature() == AssociationAttributeDefinition.AssociationNature.ENTITY ) {
      final Joinable currentEntityPersister = (Joinable) currentSource().resolveEntityReference().getEntityPersister();
      final AssociationKey currentEntityReferenceAssociationKey =
          new AssociationKey( currentEntityPersister.getTableName(), currentEntityPersister.getKeyColumnNames() );
      // if associationKey is equal to currentEntityReferenceAssociationKey
      // that means that the current EntityPersister has a single primary key attribute
      // (i.e., derived attribute) which is mapped by attributeDefinition.
      // This is not a bidirectional association.
      // TODO: AFAICT, to avoid an overflow, the associated entity must already be loaded into the session, or
View Full Code Here

TOP

Related Classes of org.hibernate.persister.walking.spi.AssociationKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.