List of usage examples for org.hibernate EmptyInterceptor EmptyInterceptor
protected EmptyInterceptor()
From source file:com.eucalyptus.entities.Interceptors.java
License:Open Source License
private static Interceptor empty() { if (interceptor != null && interceptor instanceof EmptyInterceptor) { return interceptor; } else {//from ww w . j av a 2s . c om final Interceptor i = new EmptyInterceptor() { private static final long serialVersionUID = 1L; }; if (interceptor != null && !(interceptor instanceof EmptyInterceptor)) { interceptor = i; } return i; } }
From source file:com.fortuityframework.hibernate.EventInterceptor.java
License:Apache License
/** * Creates a new event interceptor// w ww. ja v a2 s.c om * * @param broker * The eventbroker to use for dispatching events */ public EventInterceptor(IEventBroker broker) { this.broker = broker; // Anonymous class to avoid private constructor this.chainedInterceptor = new EmptyInterceptor() { private static final long serialVersionUID = 1L; }; }
From source file:com.vmware.photon.controller.apife.ApiFeService.java
License:Open Source License
private HibernateBundle<ApiFeConfiguration> getHibernateBundle() { Reflections reflections = new Reflections(getClass().getPackage().getName()); Set<Class<?>> entities = reflections.getTypesAnnotatedWith(Entity.class); ImmutableList<Class<?>> immutableEntitiesList = ImmutableList.copyOf(entities); Reflections commonReflections = new Reflections("com.vmware.esxcloud.api.common"); entities.addAll(commonReflections.getTypesAnnotatedWith(Entity.class)); return new HibernateBundle<ApiFeConfiguration>(immutableEntitiesList, new SessionFactoryFactory()) { @Override/*from w ww.j a va2 s. c om*/ public DataSourceFactory getDataSourceFactory(ApiFeConfiguration configuration) { return configuration.getDataSourceFactory(); } @Override public void configure(Configuration configuration) { configuration.setNamingStrategy(ImprovedNamingStrategy.INSTANCE); configuration.setInterceptor(new EmptyInterceptor() { @Override public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) { injector.injectMembers(entity); return true; } }); } }; }
From source file:gov.nih.nci.caarray.dao.HibernateIntegrationTestCleanUpUtility.java
License:BSD License
private static Session getSession() { // we need a session that bypasses security, so override the security interceptor here return hibernateHelper.getSessionFactory().openSession(new EmptyInterceptor() { private static final long serialVersionUID = 1L; });//from w ww. j a va 2 s . com }