Example usage for org.hibernate Interceptor beforeTransactionCompletion

List of usage examples for org.hibernate Interceptor beforeTransactionCompletion

Introduction

In this page you can find the example usage for org.hibernate Interceptor beforeTransactionCompletion.

Prototype

void beforeTransactionCompletion(Transaction tx);

Source Link

Document

Called before a transaction is committed (but not before rollback).

Usage

From source file:com.fiveamsolutions.nci.commons.util.CompositeInterceptor.java

License:Open Source License

/**
 * {@inheritDoc}/*from   ww w .j  av  a  2 s .  com*/
 */
public void beforeTransactionCompletion(Transaction arg0) {
    for (Interceptor i : children) {
        i.beforeTransactionCompletion(arg0);
    }
}

From source file:com.fiveamsolutions.nci.commons.util.CompositeInterceptorTest.java

License:Open Source License

private void helper(Interceptor i, boolean expectChanges) {
    i.afterTransactionBegin(null);/*from   w  w w  .  j  a v a 2 s .  com*/
    i.afterTransactionCompletion(null);
    i.beforeTransactionCompletion(null);
    assertNull(i.getEntity(null, null));
    assertNull(i.getEntityName(null));
    if (expectChanges) {
        assertNotNull(i.findDirty(null, null, null, null, null, null));
        assertNotNull(i.instantiate(null, null, null));
        assertNotNull(i.isTransient(null));
        assertTrue(!"foo".equals(i.onPrepareStatement("foo")));
    } else {
        assertNull(i.findDirty(null, null, null, null, null, null));
        assertNull(i.instantiate(null, null, null));
        assertNull(i.isTransient(null));
        assertEquals("foo", i.onPrepareStatement("foo"));
    }
    i.onCollectionRecreate(null, null);
    i.onCollectionRemove(null, null);
    i.onCollectionUpdate(null, null);
    i.onDelete(null, null, null, null, null);
    assertEquals(expectChanges, i.onFlushDirty(null, null, null, null, null, null));
    assertEquals(expectChanges, i.onLoad(null, null, null, null, null));
    assertEquals(expectChanges, i.onSave(null, null, null, null, null));
    i.postFlush(null);
    i.preFlush(null);
}

From source file:gov.nih.nci.cabig.ctms.audit.ChainedInterceptor.java

License:BSD License

public void beforeTransactionCompletion(Transaction transaction) {
    for (Interceptor interceptor : interceptors) {
        interceptor.beforeTransactionCompletion(transaction);
    }//from  w ww. ja v a2  s.  c  o  m
}

From source file:org.chenillekit.hibernate.interceptors.ChainedInterceptor.java

License:Apache License

public void beforeTransactionCompletion(Transaction tx) {
    for (Object o : interceptors.entrySet()) {
        Map.Entry entry = (Map.Entry) o;
        Interceptor interceptor = (Interceptor) entry.getValue();
        interceptor.beforeTransactionCompletion(tx);
    }/*from  ww w  .j  a  v  a  2 s  . c o m*/
}

From source file:org.hyperic.hibernate.DefaultInterceptorChain.java

License:Open Source License

public void beforeTransactionCompletion(HibernateInterceptorChain chain, Interceptor target, Transaction tx) {
    target.beforeTransactionCompletion(tx);
}

From source file:org.openmrs.api.db.hibernate.ChainingInterceptor.java

License:Mozilla Public License

public void beforeTransactionCompletion(Transaction tx) {
    for (Interceptor i : interceptors) {
        i.beforeTransactionCompletion(tx);
    }//from   w  ww.j a v  a  2  s  .  co  m
}

From source file:org.riotfamily.common.hibernate.ChainedInterceptor.java

License:Apache License

public void beforeTransactionCompletion(Transaction tx) {
    for (Interceptor interceptor : interceptors) {
        interceptor.beforeTransactionCompletion(tx);
    }/*from  w  w w  .  j a v  a2  s.com*/
}