Tabnine Logo
org.hibernate.engine.spi
Code IndexAdd Tabnine to your IDE (free)

How to use org.hibernate.engine.spi

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

origin: hibernate/hibernate-orm

public TransactionCompletionProcesses getTransactionCompletionProcesses() {
  if( beforeTransactionProcesses == null ) {
    beforeTransactionProcesses = new BeforeTransactionCompletionProcessQueue( session );
  }
  if( afterTransactionProcesses == null ) {
    afterTransactionProcesses = new AfterTransactionCompletionProcessQueue( session );
  }
  return new TransactionCompletionProcesses( beforeTransactionProcesses, afterTransactionProcesses );
}
origin: hibernate/hibernate-orm

private static EntityKey generateEntityKeyOrNull(Serializable id, SharedSessionContractImplementor s, String entityName) {
  if ( id == null || s == null || entityName == null ) {
    return null;
  }
  return s.generateEntityKey( id, s.getFactory().getEntityPersister( entityName ) );
}
origin: hibernate/hibernate-orm

/**
 * Get the current snapshot from the session
 */
@SuppressWarnings({"JavaDoc"})
protected final Serializable getSnapshot() {
  return session.getPersistenceContext().getSnapshot( this );
}
origin: hibernate/hibernate-orm

/**
 * entity id accessor
 *
 * @return The entity id
 */
public final Serializable getId() {
  if ( id instanceof DelayedPostInsertIdentifier ) {
    final EntityEntry entry = session.getPersistenceContext().getEntry( instance );
    final Serializable eeId = entry == null ? null : entry.getId();
    return eeId instanceof DelayedPostInsertIdentifier ? null : eeId;
  }
  return id;
}
origin: hibernate/hibernate-orm

private void checkLockMode(Object entity, LockMode expectedLockMode, Session session) {
  final LockMode lockMode =
      ( (SharedSessionContractImplementor) session ).getPersistenceContext().getEntry( entity ).getLockMode();
  assertEquals( expectedLockMode, lockMode );
}
origin: hibernate/hibernate-orm

protected boolean isConnectedToSession() {
  return session != null
      && session.isOpen()
      && session.getPersistenceContext().containsCollection( this );
}
origin: hibernate/hibernate-orm

/**
 * Down-grade locks to NONE for all entities in this context
 */
public void downgradeLocks() {
  if ( head == null ) {
    return;
  }
  ManagedEntity node = head;
  while ( node != null ) {
    node.$$_hibernate_getEntityEntry().setLockMode( LockMode.NONE );
    node = node.$$_hibernate_getNextManagedEntity();
  }
}
origin: hibernate/hibernate-orm

protected SessionBuilder newSession(String tenant) {
  return sessionFactory
    .withOptions()
    .tenantIdentifier( tenant );
}
origin: hibernate/hibernate-orm

@Override
public boolean isReadOnly() {
  return ( readOnly == null ?
      producer.getPersistenceContext().isDefaultReadOnly() :
      readOnly
  );
}
origin: hibernate/hibernate-orm

@Override
public Object getForInsert(Object owner, Map mergeMap, SharedSessionContractImplementor session) {
  if ( session == null ) {
    return PropertyAccessStrategyBackRefImpl.UNKNOWN;
  }
  else {
    return session.getPersistenceContext().getIndexInOwner( entityName, propertyName, owner, mergeMap );
  }
}
origin: hibernate/hibernate-orm

@Override
public Object getForInsert(Object owner, Map mergeMap, SharedSessionContractImplementor session) {
  if ( session == null ) {
    return UNKNOWN;
  }
  else {
    return session.getPersistenceContext().getOwnerId( entityName, propertyName, owner, mergeMap );
  }
}
origin: hibernate/hibernate-orm

public boolean hasAnyQueuedActions() {
  return ( updates != null && !updates.isEmpty() ) || ( insertions != null && !insertions.isEmpty() ) || hasUnresolvedEntityInsertActions()
      || ( deletions != null && !deletions.isEmpty()) || ( collectionUpdates != null && !collectionUpdates.isEmpty() )
      || ( collectionQueuedOps != null && !collectionQueuedOps.isEmpty() ) || ( collectionRemovals != null && !collectionRemovals.isEmpty() )
      || ( collectionCreations != null && !collectionCreations.isEmpty() );
}
origin: hibernate/hibernate-orm

public FetchGraphLoadPlanBuildingStrategy(
    final SessionFactoryImplementor sessionFactory,
    RootGraphImplementor graph,
    final LoadQueryInfluencers loadQueryInfluencers,
    final LockMode lockMode) {
  super( sessionFactory, loadQueryInfluencers, lockMode );
  this.rootEntityGraph = graph;
}
origin: hibernate/hibernate-orm

/**
 * Perform all currently queued entity-insertion actions.
 *
 * @throws HibernateException error executing queued insertion actions.
 */
public void executeInserts() throws HibernateException {
  if ( insertions != null && !insertions.isEmpty() ) {
    executeActions( insertions );
  }
}
origin: hibernate/hibernate-orm

public void sortActions() {
  if ( isOrderUpdatesEnabled() && updates != null ) {
    // sort the updates by pk
    updates.sort();
  }
  if ( isOrderInsertsEnabled() && insertions != null ) {
    insertions.sort();
  }
}
origin: hibernate/hibernate-orm

  @SuppressWarnings({ "unchecked", "deprecation" })
  @Override
  public T owner(SessionOwner sessionOwner) {
    delegate().owner( sessionOwner );
    return (T) this;
  }
}
origin: hibernate/hibernate-orm

@Override
public void jdbcExecuteStatementStart() {
  session.getEventListenerManager().jdbcExecuteStatementStart();
}
origin: hibernate/hibernate-orm

@Override
public void jdbcExecuteBatchEnd() {
  session.getEventListenerManager().jdbcExecuteBatchEnd();
}
origin: hibernate/hibernate-orm

/**
 * Check whether any insertion or deletion actions are currently queued.
 *
 * @return {@code true} if insertions or deletions are currently queued; {@code false} otherwise.
 */
public boolean areInsertionsOrDeletionsQueued() {
  return ( insertions != null && !insertions.isEmpty() ) || hasUnresolvedEntityInsertActions() || (deletions != null && !deletions.isEmpty()) || (orphanRemovals != null && !orphanRemovals.isEmpty());
}
origin: hibernate/hibernate-orm

public LoadGraphLoadPlanBuildingStrategy(
    SessionFactoryImplementor factory,
    RootGraphImplementor<?> graph,
    LoadQueryInfluencers queryInfluencers,
    LockMode lockMode) {
  super( factory, queryInfluencers, lockMode );
  this.rootEntityGraph = graph;
}
org.hibernate.engine.spi

Most used classes

  • SessionFactoryImplementor
    Defines the internal contract between the SessionFactory and other parts of Hibernate such as implem
  • SessionImplementor
    Defines the internal contract between org.hibernate.Session / org.hibernate.StatelessSession and oth
  • PersistenceContext
    Represents the state of "stuff" Hibernate is tracking, including (not exhaustive): * entities * col
  • RowSelection
    Represents a selection criteria for rows in a JDBC java.sql.ResultSet
  • EntityEntry
    We need an entry to tell us all about the current state of an object with respect to its persistent
  • SharedSessionContractImplementor,
  • TypedValue,
  • ActionQueue,
  • SubselectFetch,
  • CollectionEntry,
  • ExceptionConverter,
  • EntityKey,
  • LoadQueryInfluencers,
  • SessionBuilderImplementor,
  • FilterDefinition,
  • NamedQueryDefinition,
  • BatchFetchQueue,
  • CacheImplementor,
  • CollectionKey
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