Code example for EmptyInterceptor

0
 * Our custom {@link org.hibernate.Interceptor} impl which performs the 
 * interpretation of entity-name -> proxy instance and vice-versa. 
 * 
 * @author <a href="mailto:steve@hibernate.org">Steve Ebersole </a> 
 */ 
public class ProxyInterceptor extends EmptyInterceptor {
 
	/** 
	 * The callback from Hibernate to determine the entity name given 
	 * a presumed entity instance. 
	 * 
	 * @param object The presumed entity instance. 
	 * @return The entity name (pointing to the proper entity mapping). 
	 */ 
	public String getEntityName(Object object) {
		String entityName = ProxyHelper.extractEntityName( object );
		if ( entityName == null ) {
			entityName = super.getEntityName( object );
		} 
		return entityName;