Package org.hibernate.engine

Examples of org.hibernate.engine.CollectionKey


          matches = new ArrayList();
        }
        matches.add( lce );
        if ( lce.getCollection().getOwner() == null ) {
          session.getPersistenceContext().addUnownedCollection(
              new CollectionKey( persister, lce.getKey(), session.getEntityMode() ),
              lce.getCollection()
          );
        }
        if ( log.isTraceEnabled() ) {
          log.trace( "removing collection load entry [" + lce + "]" );
View Full Code Here


   * @param persister The collection persister
   * @param ownerKey The owner key
   * @return The loading collection, or null if not found.
   */
  public PersistentCollection locateLoadingCollection(CollectionPersister persister, Serializable ownerKey) {
    LoadingCollectionEntry lce = locateLoadingCollectionEntry( new CollectionKey( persister, ownerKey, getEntityMode() ), null ); // note: null because here we are interested in all contexts...
    if ( lce != null ) {
      if ( log.isTraceEnabled() ) {
        log.trace( "returning loading collection:" + MessageHelper.collectionInfoString( persister, ownerKey, getSession().getFactory() ) );
      }
      return lce.getCollection();
View Full Code Here

   *
   * @return The loading collection (see discussion above).
   */
  public PersistentCollection getLoadingCollection(final CollectionPersister persister, final Serializable key) {
    final EntityMode em = loadContexts.getPersistenceContext().getSession().getEntityMode();
    final CollectionKey collectionKey = new CollectionKey( persister, key, em );
    if ( log.isTraceEnabled() ) {
      log.trace( "starting attempt to find loading collection [" + MessageHelper.collectionInfoString( persister.getRole(), key ) + "]" );
    }
    final LoadingCollectionEntry loadingCollectionEntry = loadContexts.locateLoadingCollectionEntry( collectionKey );
    if ( loadingCollectionEntry == null ) {
View Full Code Here

    // the #endRead processing.
    List matches = null;
    Iterator iter = loadContexts.getLoadingCollectionEntryMap().entrySet().iterator();
    while ( iter.hasNext() ) {
      final Map.Entry mapEntry = ( Map.Entry ) iter.next();
      final CollectionKey collectionKey = ( CollectionKey ) mapEntry.getKey();
      final LoadingCollectionEntry lce = ( LoadingCollectionEntry ) mapEntry.getValue();
      if ( localLoadingCollectionKeys.contains( collectionKey ) && lce.getResultSet() == resultSet && lce.getPersister() == persister) {
        if ( matches == null ) {
          matches = new ArrayList();
        }
        matches.add( lce );
        if ( lce.getCollection().getOwner() == null ) {
          session.getPersistenceContext().addUnownedCollection(
              new CollectionKey( persister, lce.getKey(), session.getEntityMode() ),
              lce.getCollection()
          );
        }
        if ( log.isTraceEnabled() ) {
          log.trace( "removing collection load entry [" + lce + "]" );
View Full Code Here

   * @param persister The collection persister
   * @param ownerKey The owner key
   * @return The loading collection, or null if not found.
   */
  public PersistentCollection locateLoadingCollection(CollectionPersister persister, Serializable ownerKey) {
    LoadingCollectionEntry lce = locateLoadingCollectionEntry( new CollectionKey( persister, ownerKey, getEntityMode() ) );
    if ( lce != null ) {
      if ( log.isTraceEnabled() ) {
        log.trace( "returning loading collection:" + MessageHelper.collectionInfoString( persister, ownerKey, getSession().getFactory() ) );
      }
      return lce.getCollection();
View Full Code Here

  }

  /*package*/void cleanupCollectionEntries(Set entryKeys) {
    Iterator itr = entryKeys.iterator();
    while ( itr.hasNext() ) {
      final CollectionKey entryKey = ( CollectionKey ) itr.next();
      xrefLoadingCollectionEntries.remove( entryKey );
    }
  }
View Full Code Here

   *
   * @return The loading collection (see discussion above).
   */
  public PersistentCollection getLoadingCollection(final CollectionPersister persister, final Serializable key) {
    final EntityMode em = loadContexts.getPersistenceContext().getSession().getEntityMode();
    final CollectionKey collectionKey = new CollectionKey( persister, key, em );
    if ( log.isTraceEnabled() ) {
      log.trace( "starting attempt to find loading collection [" + MessageHelper.collectionInfoString( persister.getRole(), key ) + "]" );
    }
    final LoadingCollectionEntry loadingCollectionEntry = loadContexts.locateLoadingCollectionEntry( collectionKey );
    if ( loadingCollectionEntry == null ) {
View Full Code Here

    // in a temp collection.  the temp collection is then used to "drive"
    // the #endRead processing.
    List matches = null;
    Iterator iter = localLoadingCollectionKeys.iterator();
    while ( iter.hasNext() ) {
      final CollectionKey collectionKey = (CollectionKey) iter.next();
      final LoadingCollectionEntry lce = loadContexts.locateLoadingCollectionEntry( collectionKey );
      if ( lce == null) {
        log.warn( "In CollectionLoadContext#endLoadingCollections, localLoadingCollectionKeys contained [" + collectionKey + "], but no LoadingCollectionEntry was found in loadContexts" );
      }
      else if ( lce.getResultSet() == resultSet && lce.getPersister() == persister ) {
        if ( matches == null ) {
          matches = new ArrayList();
        }
        matches.add( lce );
       
        if ( lce.getCollection().getOwner() == null ) {
          session.getPersistenceContext().addUnownedCollection(
              new CollectionKey( persister, lce.getKey(), session.getEntityMode() ),
              lce.getCollection()
          );
        }
        if ( log.isTraceEnabled() ) {
          log.trace( "removing collection load entry [" + lce + "]" );
View Full Code Here

TOP

Related Classes of org.hibernate.engine.CollectionKey

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.