|
Hibernate example source code file (LocalExceptionInterceptor.java)
The Hibernate LocalExceptionInterceptor.java source code//$ package org.hibernate.ejb.test.ejb3configuration; import java.io.Serializable; import org.hibernate.CallbackException; import org.hibernate.type.Type; /** * @author Emmanuel Bernard */ public class LocalExceptionInterceptor extends ExceptionInterceptor { public static final String LOCAL_EXCEPTION_MESSAGE = "Session-scoped interceptor enabled"; public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException { if (allowSave) return false; throw new IllegalStateException( LOCAL_EXCEPTION_MESSAGE ); } } Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate LocalExceptionInterceptor.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.