Package org.hibernate.engine

Examples of org.hibernate.engine.Cascade


      Object anything) {

    // cascade-save to many-to-one BEFORE the parent is saved
    source.getPersistenceContext().incrementCascadeLevel();
    try {
      new Cascade( getCascadeAction(), Cascade.BEFORE_INSERT_AFTER_DELETE, source )
          .cascade( persister, entity, anything );
    }
    finally {
      source.getPersistenceContext().decrementCascadeLevel();
    }
View Full Code Here


      Object anything) {

    // cascade-save to collections AFTER the collection owner was saved
    source.getPersistenceContext().incrementCascadeLevel();
    try {
      new Cascade( getCascadeAction(), Cascade.AFTER_INSERT_BEFORE_DELETE, source )
          .cascade( persister, entity, anything );
    }
    finally {
      source.getPersistenceContext().decrementCascadeLevel();
    }
View Full Code Here

    final Object entity,
    final Map copyCache
  ) {
    source.getPersistenceContext().incrementCascadeLevel();
    try {
      new Cascade( getCascadeAction(), Cascade.BEFORE_MERGE, source )
          .cascade(persister, entity, copyCache);
    }
    finally {
      source.getPersistenceContext().decrementCascadeLevel();
    }
View Full Code Here

      id = e.getId();
    }

    // cascade the refresh prior to refreshing this entity
    refreshedAlready.put(object, object);
    new Cascade(CascadingAction.REFRESH, Cascade.BEFORE_REFRESH, source)
        .cascade( persister, object, refreshedAlready );

    if ( e != null ) {
      EntityKey key = new EntityKey( id, persister, source.getEntityMode() );
      source.getPersistenceContext().removeEntity(key);
View Full Code Here

 
  private void cascadeOnFlush(EventSource session, EntityPersister persister, Object object, Object anything)
  throws HibernateException {
    session.getPersistenceContext().incrementCascadeLevel();
    try {
      new Cascade( getCascadingAction(), Cascade.BEFORE_FLUSH, session )
      .cascade( persister, object, anything );
    }
    finally {
      session.getPersistenceContext().decrementCascadeLevel();
    }
View Full Code Here

    final Object entity,
    final Map copyCache
  ) {
    source.getPersistenceContext().incrementCascadeLevel();
    try {
      new Cascade( getCascadeAction(), Cascade.BEFORE_MERGE, source )
          .cascade(persister, entity, copyCache);
    }
    finally {
      source.getPersistenceContext().decrementCascadeLevel();
    }
View Full Code Here

      Object anything) {

    // cascade-save to many-to-one BEFORE the parent is saved
    source.getPersistenceContext().incrementCascadeLevel();
    try {
      new Cascade( getCascadeAction(), Cascade.BEFORE_INSERT_AFTER_DELETE, source )
          .cascade( persister, entity, anything );
    }
    finally {
      source.getPersistenceContext().decrementCascadeLevel();
    }
View Full Code Here

      Object anything) {

    // cascade-save to collections AFTER the collection owner was saved
    source.getPersistenceContext().incrementCascadeLevel();
    try {
      new Cascade( getCascadeAction(), Cascade.AFTER_INSERT_BEFORE_DELETE, source )
          .cascade( persister, entity, anything );
    }
    finally {
      source.getPersistenceContext().decrementCascadeLevel();
    }
View Full Code Here

   */
  private void cascadeOnUpdate(SaveOrUpdateEvent event, EntityPersister persister, Object entity) {
    EventSource source = event.getSession();
    source.getPersistenceContext().incrementCascadeLevel();
    try {
      new Cascade( CascadingAction.SAVE_UPDATE, Cascade.AFTER_UPDATE, source )
          .cascade( persister, entity );
    }
    finally {
      source.getPersistenceContext().decrementCascadeLevel();
    }
View Full Code Here

    CacheMode cacheMode = session.getCacheMode();
    session.setCacheMode( CacheMode.GET );
    session.getPersistenceContext().incrementCascadeLevel();
    try {
      // cascade-delete to collections BEFORE the collection owner is deleted
      new Cascade( CascadingAction.DELETE, Cascade.AFTER_INSERT_BEFORE_DELETE, session )
          .cascade( persister, entity, transientEntities );
    }
    finally {
      session.getPersistenceContext().decrementCascadeLevel();
      session.setCacheMode( cacheMode );
View Full Code Here

TOP

Related Classes of org.hibernate.engine.Cascade

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.