Package org.hibernate.ogm.grid

Examples of org.hibernate.ogm.grid.EntityKey


        EntityEntry entry = session.getPersistenceContext().getEntry( entity );
        loadedState = entry.getLoadedState();
      }
    }

    final EntityKey key = EntityKeyBuilder.fromPersister( this, id, session );
    final Tuple resultset = gridDialect.getTuple( key, this.getTupleContext() );
    final SessionFactoryImplementor factory = getFactory();
    if ( isImpliedOptimisticLocking && loadedState != null ) {
      // we need to utilize dynamic delete statements
      for ( int j = span - 1; j >= 0; j-- ) {
View Full Code Here


  private void updateInverseSideOfAssociationNavigation(SessionImplementor session, Object entity, Tuple tuple, Action action, RowKey rowKey) {
    if ( associationType == AssociationType.EMBEDDED_FK_TO_ENTITY ) {
      // update the associated object
      Serializable entityId = (Serializable) gridTypeOfAssociatedId.nullSafeGet( tuple, getElementColumnNames(), session, null );
      OgmEntityPersister persister = (OgmEntityPersister) getElementPersister();
      final EntityKey entityKey = EntityKeyBuilder.fromPersister( persister, entityId, session );

      final Tuple entityTuple = gridDialect.getTuple( entityKey, persister.getTupleContext() );
      // the entity tuple could already be gone (not 100% sure this can happen but that feels right)
      if ( entityTuple == null ) {
        return;
View Full Code Here

    }
    return values;
  }

  private Tuple getResultsetById(Serializable id, SessionImplementor session) {
    final EntityKey key = EntityKeyBuilder.fromPersister( this, id, session );
    final Tuple resultset = gridDialect.getTuple( key, this.getTupleContext() );
    return resultset;
  }
View Full Code Here

    /*
     * We get the value from the grid and compare the version values before putting the next version in
     * Contrary to the database version, there is
     * TODO should we use cache.replace() it seems more expensive to pass the resultset around "just" the atomicity of the operation
     */
    final EntityKey key = EntityKeyBuilder.fromPersister( this, id, session );
    final Tuple resultset = gridDialect.getTuple( key, this.getTupleContext() );
    checkVersionAndRaiseSOSE(id, currentVersion, session, resultset);
    gridVersionType.nullSafeSet( resultset, nextVersion, new String[] { getVersionColumnName() }, session );
    gridDialect.updateTuple( resultset, key );
    return nextVersion;
View Full Code Here

    }

    for ( int j = 0; j < span; j++ ) {
      // Now update only the tables with dirty properties (and the table with the version number)
      if ( tableUpdateNeeded[j] ) {
        final EntityKey key = EntityKeyBuilder.fromPersister( this, id, session );
        Tuple resultset = gridDialect.getTuple( key, this.getTupleContext() );
        final boolean useVersion = j == 0 && isVersioned();

        resultset = createNewResultSetIfNull( key, resultset, id, session );
View Full Code Here

        if ( j == 0 && isVersioned() ) {
          log.trace( "Version: " + Versioning.getVersion( fields, this ) );
        }
      }

      final EntityKey key = EntityKeyBuilder.fromPersister( this, id, session );
      Tuple resultset = gridDialect.getTuple( key, this.getTupleContext() );
      // add the discriminator
      if ( j == 0 ) {
        if (resultset != null) {
          throw new HibernateException( "trying to insert an already existing entity: "
View Full Code Here

        EntityEntry entry = session.getPersistenceContext().getEntry( entity );
        loadedState = entry.getLoadedState();
      }
    }

    final EntityKey key = EntityKeyBuilder.fromPersister( this, id, session );
    final Tuple resultset = gridDialect.getTuple( key, this.getTupleContext() );
    final SessionFactoryImplementor factory = getFactory();
    if ( isImpliedOptimisticLocking && loadedState != null ) {
      // we need to utilize dynamic delete statements
      for ( int j = span - 1; j >= 0; j-- ) {
View Full Code Here

        id,
        identifierGridType,
        identifierColumnNames,
        session
    );
    return new EntityKey( tableName, identifierColumnNames, values );
  }
View Full Code Here

  private void updateInverseSideOfAssociationNavigation(SessionImplementor session, Tuple tuple, Action action, RowKey rowKey) {
    if ( associationType == AssociationType.EMBEDDED_FK_TO_ENTITY ) {
      //update the associated object
      Serializable entityId = (Serializable) gridTypeOfAssociatedId.nullSafeGet( tuple, getElementColumnNames(), session, null );
      OgmEntityPersister persister = (OgmEntityPersister) getElementPersister();
      final EntityKey entityKey = EntityKeyBuilder.fromPersister( persister, entityId, session );
      final Tuple entityTuple = gridDialect.getTuple( entityKey, persister.getTupleContext() );
      //the entity tuple could already be gone (not 100% sure this can happen but that feels right)
      if (entityTuple == null) {
        return;
      }
View Full Code Here

  }

  @Override
  public void lock(Serializable id, Object version, Object object, int timeout, SessionImplementor session) throws StaleObjectStateException, JDBCException {
    MapDatastoreProvider dataStore = getProvider( session );
    EntityKey key = EntityKeyBuilder.fromData(
        lockable.getRootTableName(),
        lockable.getRootTableIdentifierColumnNames(),
        identifierGridType,
        id,
        session );
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.grid.EntityKey

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.