Tabnine Logo
CollectionEntry.getLoadedKey
Code IndexAdd Tabnine to your IDE (free)

How to use
getLoadedKey
method
in
org.hibernate.engine.spi.CollectionEntry

Best Java code snippets using org.hibernate.engine.spi.CollectionEntry.getLoadedKey (Showing top 20 results out of 315)

origin: hibernate/hibernate-orm

public boolean wasDereferenced() {
  return getLoadedKey() == null;
}
origin: hibernate/hibernate-orm

public Serializable getKey() {
  return getLoadedKey();
}
origin: hibernate/hibernate-orm

/**
 * Get the ID for the entity that owned this persistent collection when it was loaded
 *
 * @param ce The collection entry
 * @return the owner ID if available from the collection's loaded key; otherwise, returns null
 */
private Serializable getLoadedCollectionOwnerIdOrNull(CollectionEntry ce) {
  if ( ce == null || ce.getLoadedKey() == null || ce.getLoadedPersister() == null ) {
    return null;
  }
  // TODO: an alternative is to check if the owner has changed; if it hasn't then
  // get the ID from collection.getOwner()
  return ce.getLoadedPersister().getCollectionType().getIdOfOwnerOrNull( ce.getLoadedKey(), session );
}
origin: hibernate/hibernate-orm

final PersistentCollection collection = me.getValue();
if ( ce.getLoadedKey() == null ) {
    ce.getLoadedKey(),
    collectionPersister.getFactory()
);
else if ( !isCached( ce.getLoadedKey(), collectionPersister ) ) {
  keys[i++] = ce.getLoadedKey();
origin: hibernate/hibernate-orm

ce.getLoadedPersister(),
this,
ce.getLoadedKey(),
session
origin: hibernate/hibernate-orm

private static void processNeverReferencedCollection(PersistentCollection coll, SessionImplementor session)
    throws HibernateException {
  final PersistenceContext persistenceContext = session.getPersistenceContext();
  final CollectionEntry entry = persistenceContext.getCollectionEntry( coll );
  if ( LOG.isDebugEnabled() ) {
    LOG.debugf(
        "Found collection with unloaded owner: %s",
        MessageHelper.collectionInfoString( 
            entry.getLoadedPersister(),
            coll,
            entry.getLoadedKey(),
            session
        )
    );
  }
  entry.setCurrentPersister( entry.getLoadedPersister() );
  entry.setCurrentKey( entry.getLoadedKey() );
  prepareCollectionForUpdate( coll, entry, session.getFactory() );
}
origin: hibernate/hibernate-orm

private void evictCollection(PersistentCollection collection) {
  CollectionEntry ce = (CollectionEntry) getSession().getPersistenceContext().getCollectionEntries().remove(collection);
  if ( LOG.isDebugEnabled() ) {
    LOG.debugf(
        "Evicting collection: %s",
        MessageHelper.collectionInfoString( ce.getLoadedPersister(),
            collection,
            ce.getLoadedKey(),
            getSession() ) );
  }
  if (ce.getLoadedPersister() != null && ce.getLoadedPersister().getBatchSize() > 1) {
    getSession().getPersistenceContext().getBatchFetchQueue().removeBatchLoadableCollection(ce);
  }
  if ( ce.getLoadedPersister() != null && ce.getLoadedKey() != null ) {
    //TODO: is this 100% correct?
    getSession().getPersistenceContext().getCollectionsByKey().remove(
        new CollectionKey( ce.getLoadedPersister(), ce.getLoadedKey() )
    );
  }
}

origin: hibernate/hibernate-orm

    collectionEntry.getLoadedKey()
);
persistenceContext.getCollectionsByKey().put(collectionKey, persistentCollection);
origin: hibernate/hibernate-orm

  @Override
  public Boolean doWork() {
    final CollectionEntry entry = session.getPersistenceContext().getCollectionEntry( AbstractPersistentCollection.this );
    final CollectionPersister persister = entry.getLoadedPersister();
    if ( persister.isExtraLazy() ) {
      if ( hasQueuedOperations() ) {
        session.flush();
      }
      return persister.indexExists( entry.getLoadedKey(), index, session );
    }
    else {
      read();
    }
    return null;
  }
}
origin: hibernate/hibernate-orm

  @Override
  public Boolean doWork() {
    final CollectionEntry entry = session.getPersistenceContext().getCollectionEntry( AbstractPersistentCollection.this );
    final CollectionPersister persister = entry.getLoadedPersister();
    if ( persister.isExtraLazy() ) {
      if ( hasQueuedOperations() ) {
        session.flush();
      }
      return persister.elementExists( entry.getLoadedKey(), element, session );
    }
    else {
      read();
    }
    return null;
  }
}
origin: hibernate/hibernate-orm

  @Override
  public Boolean doWork() {
    final CollectionEntry entry = session.getPersistenceContext().getCollectionEntry( AbstractPersistentCollection.this );
    if ( entry != null ) {
      final CollectionPersister persister = entry.getLoadedPersister();
      if ( persister.isExtraLazy() ) {
        if ( hasQueuedOperations() ) {
          session.flush();
        }
        cachedSize = persister.getSize( entry.getLoadedKey(), session );
        return true;
      }
      else {
        read();
      }
    }
    else{
      throwLazyInitializationExceptionIfNotConnected();
    }
    return false;
  }
}
origin: hibernate/hibernate-orm

session.getInterceptor().onCollectionRemove( coll, ce.getLoadedKey() );
actionQueue.addAction(
    new CollectionRemoveAction(
        coll,
        ce.getLoadedPersister(),
        ce.getLoadedKey(),
        ce.isSnapshotEmpty(coll),
        session
session.getInterceptor().onCollectionUpdate( coll, ce.getLoadedKey() );
actionQueue.addAction(
    new CollectionUpdateAction(
        coll,
        ce.getLoadedPersister(),
        ce.getLoadedKey(),
        ce.isSnapshotEmpty(coll),
        session
        coll,
        ce.getLoadedPersister(),
        ce.getLoadedKey(),
        session
origin: hibernate/hibernate-orm

        ce.getLoadedPersister(),
        collection,
        ce.getLoadedKey(),
        source
  ce.getLoadedKey(),
  ce.getLoadedPersister(),
  collection,
  LOG.trace( "Collection not cached" );
ce.getLoadedPersister().initialize( ce.getLoadedKey(), source );
if ( traceEnabled ) {
  LOG.trace( "Collection initialized" );
origin: hibernate/hibernate-orm

public void preFlush(PersistentCollection collection) throws HibernateException {
  if ( loadedKey == null && collection.getKey() != null ) {
    loadedKey = collection.getKey();
  }
  boolean nonMutableChange = collection.isDirty()
      && getLoadedPersister() != null
      && !getLoadedPersister().isMutable();
  if ( nonMutableChange ) {
    throw new HibernateException(
        "changed an immutable collection instance: " +
        MessageHelper.collectionInfoString( getLoadedPersister().getRole(), getLoadedKey() )
    );
  }
  dirty( collection );
  if ( LOG.isDebugEnabled() && collection.isDirty() && getLoadedPersister() != null ) {
    LOG.debugf(
        "Collection dirty: %s",
        MessageHelper.collectionInfoString( getLoadedPersister().getRole(), getLoadedKey() )
    );
  }
  setReached( false );
  setProcessed( false );
  setDoupdate( false );
  setDoremove( false );
  setDorecreate( false );
}
origin: hibernate/hibernate-orm

&& !currentPersister.getKeyType().isEqual( entry.getLoadedKey(), entry.getCurrentKey(), factory )
&& !( entry.getLoadedKey() instanceof DelayedPostInsertIdentifier );
origin: hibernate/hibernate-orm

new TypedValue(
    entry.getLoadedPersister().getKeyType(),
    entry.getLoadedKey()
origin: hibernate/hibernate-orm

ce.getLoadedPersister(),
collection,
ce.getLoadedKey(),
session
ce.getLoadedPersister(),
collection,
ce.getLoadedKey(),
session
origin: hibernate/hibernate-orm

"Collection dereferenced: %s",
MessageHelper.collectionInfoString( loadedPersister, 
    coll, entry.getLoadedKey(), session
origin: org.hibernate/com.springsource.org.hibernate

private static void processNeverReferencedCollection(PersistentCollection coll, SessionImplementor session)
throws HibernateException {
  final PersistenceContext persistenceContext = session.getPersistenceContext();
  CollectionEntry entry = persistenceContext.getCollectionEntry(coll);
  if ( LOG.isDebugEnabled() ) {
    LOG.debugf( "Found collection with unloaded owner: %s",
        MessageHelper.collectionInfoString( entry.getLoadedPersister(), entry.getLoadedKey(), session.getFactory() ) );
  }
  entry.setCurrentPersister( entry.getLoadedPersister() );
  entry.setCurrentKey( entry.getLoadedKey() );
  prepareCollectionForUpdate( coll, entry, session.getFactory() );
}
origin: org.hibernate/com.springsource.org.hibernate.core

private static void processNeverReferencedCollection(PersistentCollection coll, SessionImplementor session)
throws HibernateException {
  final PersistenceContext persistenceContext = session.getPersistenceContext();
  CollectionEntry entry = persistenceContext.getCollectionEntry(coll);
  if ( LOG.isDebugEnabled() ) {
    LOG.debugf( "Found collection with unloaded owner: %s",
        MessageHelper.collectionInfoString( entry.getLoadedPersister(), entry.getLoadedKey(), session.getFactory() ) );
  }
  entry.setCurrentPersister( entry.getLoadedPersister() );
  entry.setCurrentKey( entry.getLoadedKey() );
  prepareCollectionForUpdate( coll, entry, session.getFactory() );
}
org.hibernate.engine.spiCollectionEntrygetLoadedKey

Popular methods of CollectionEntry

  • getLoadedPersister
    This is only available late during the flush cycle
  • getSnapshot
  • getOrphans
    Get the collection orphans (entities which were removed from the collection)
  • <init>
    For newly wrapped collections, or dereferenced collection wrappers
  • afterAction
    Called after execution of an action
  • afterDeserialize
  • deserialize
    Custom deserialization routine used during deserialization of a Session/PersistenceContext for incre
  • dirty
    Determine if the collection is "really" dirty, by checking dirtiness of the collection elements, if
  • getCurrentKey
    This is only available late during the flush cycle
  • getCurrentPersister
  • getRole
  • isDorecreate
  • getRole,
  • isDorecreate,
  • isDoremove,
  • isDoupdate,
  • isIgnore,
  • isProcessed,
  • isReached,
  • isSnapshotEmpty,
  • postFlush

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • getExternalFilesDir (Context)
  • getResourceAsStream (ClassLoader)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now