Example usage for org.hibernate Interceptor onCollectionRecreate

List of usage examples for org.hibernate Interceptor onCollectionRecreate

Introduction

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

Prototype

void onCollectionRecreate(Object collection, Serializable key) throws CallbackException;

Source Link

Document

Called before a collection is (re)created.

Usage

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

License:Open Source License

/**
 * {@inheritDoc}//from  ww w .j  a  va2  s . c  om
 */
public void onCollectionRecreate(Object arg0, Serializable arg1) {
    for (Interceptor i : children) {
        i.onCollectionRecreate(arg0, arg1);
    }
}

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

License:Open Source License

private void helper(Interceptor i, boolean expectChanges) {
    i.afterTransactionBegin(null);//  w  ww.  java  2 s .  c  om
    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 onCollectionRecreate(Object collection, Serializable key) throws CallbackException {
    for (Interceptor interceptor : interceptors) {
        interceptor.onCollectionRecreate(collection, key);
    }//  w  w  w.ja  v a 2 s .  c o  m
}

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

License:Open Source License

public void onCollectionRecreate(HibernateInterceptorChain chain, Interceptor target, Object collection,
        Serializable key) throws CallbackException {
    target.onCollectionRecreate(collection, key);
}

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

License:Mozilla Public License

public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException {
    for (Interceptor i : interceptors) {
        i.onCollectionRecreate(collection, key);
    }//from  w w  w. j a va  2s.c o m
}

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

License:Apache License

public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException {

    for (Interceptor interceptor : interceptors) {
        interceptor.onCollectionRecreate(collection, key);
    }// w  w w  .jav  a  2 s  . c om
}