Package org.hibernate.action

Examples of org.hibernate.action.EntityInsertAction


     */
    public void sort() {

      // the list of entity names that indicate the batch number
      for ( Iterator actionItr = insertions.iterator(); actionItr.hasNext(); ) {
        EntityInsertAction action = ( EntityInsertAction ) actionItr.next();
        // remove the current element from insertions. It will be added back later.
        String entityName = action.getEntityName();

        // the entity associated with the current action.
        Object currentEntity = action.getInstance();

        Integer batchNumber;
        if ( latestBatches.containsKey( entityName ) ) {
          // There is already an existing batch for this type of entity.
          // Check to see if the latest batch is acceptable.
          batchNumber = findBatchNumber( action, entityName );
        }
        else {
          // add an entry for this type of entity.
          // we can be assured that all referenced entities have already
          // been processed,
          // so specify that this entity is with the latest batch.
          // doing the batch number before adding the name to the list is
          // a faster way to get an accurate number.

          batchNumber = ( actionBatches.size() );
          latestBatches.put( entityName, batchNumber );
        }
        entityBatchNumber.put( currentEntity, batchNumber );
        addToBatch( batchNumber, action );
      }
      insertions.clear();

      // now rebuild the insertions list. There is a batch for each entry in the name list.
      for ( int i = 0; i < actionBatches.size(); i++ ) {
        List batch = ( List ) actionBatches.get( ( i ) );
        for ( Iterator batchItr = batch.iterator(); batchItr.hasNext(); ) {
          EntityInsertAction action = ( EntityInsertAction ) batchItr.next();
          insertions.add( action );
        }
      }
    }
View Full Code Here


    );
    //source.getPersistenceContext().removeNonExist( new EntityKey( id, persister, source.getEntityMode() ) );

    if ( !useIdentityColumn ) {
      source.getActionQueue().addAction(
          new EntityInsertAction( id, values, entity, version, persister, source )
      );
    }

    cascadeAfterSave( source, persister, entity, anything );
View Full Code Here

      // now rebuild the insertions list. There is a batch for each entry in the name list.
      for ( int i = 0; i < actionBatches.size(); i++ ) {
        List batch = ( List ) actionBatches.get( new Integer( i ) );
        for ( Object aBatch : batch ) {
          EntityInsertAction action = (EntityInsertAction) aBatch;
          insertions.add( action );
        }
      }
    }
View Full Code Here

     */
    public void sort() {

      // the list of entity names that indicate the batch number
      for ( Iterator actionItr = insertions.iterator(); actionItr.hasNext(); ) {
        EntityInsertAction action = ( EntityInsertAction ) actionItr.next();
        // remove the current element from insertions. It will be added back later.
        String entityName = action.getEntityName();

        // the entity associated with the current action.
        Object currentEntity = action.getInstance();

        Integer batchNumber;
        if ( latestBatches.containsKey( entityName ) ) {
          // There is already an existing batch for this type of entity.
          // Check to see if the latest batch is acceptable.
          batchNumber = findBatchNumber( action, entityName );
        }
        else {
          // add an entry for this type of entity.
          // we can be assured that all referenced entities have already
          // been processed,
          // so specify that this entity is with the latest batch.
          // doing the batch number before adding the name to the list is
          // a faster way to get an accurate number.

          batchNumber = new Integer( actionBatches.size() );
          latestBatches.put( entityName, batchNumber );
        }
        entityBatchNumber.put( currentEntity, batchNumber );
        addToBatch( batchNumber, action );
      }
      insertions.clear();

      // now rebuild the insertions list. There is a batch for each entry in the name list.
      for ( int i = 0; i < actionBatches.size(); i++ ) {
        List batch = ( List ) actionBatches.get( new Integer( i ) );
        for ( Iterator batchItr = batch.iterator(); batchItr.hasNext(); ) {
          EntityInsertAction action = ( EntityInsertAction ) batchItr.next();
          insertions.add( action );
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.hibernate.action.EntityInsertAction

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.