org.lexevs.dao.database.hibernate.prefix
Class PrefixInterceptor

java.lang.Object
  extended by org.hibernate.EmptyInterceptor
      extended by org.lexevs.dao.database.hibernate.prefix.PrefixInterceptor
All Implemented Interfaces:
java.io.Serializable, org.hibernate.Interceptor

public class PrefixInterceptor
extends org.hibernate.EmptyInterceptor

Hibernate Interceptor used to modify the SQL query sent to the database. This interceptor changes the prefix, and also places some extra constraints on the query to ensure that critical queries always use DB table indexes.

Author:
Kevin Peterson
See Also:
Serialized Form

Field Summary
static java.lang.String PREFIX_PLACEHOLDER
          The PREFI x_ placeholder.
 
Fields inherited from class org.hibernate.EmptyInterceptor
INSTANCE
 
Constructor Summary
PrefixInterceptor()
          Instantiates a new prefix interceptor.
PrefixInterceptor(PrefixResolver prefixResolver)
          Instantiates a new prefix interceptor.
 
Method Summary
 PrefixResolver getPrefixResolver()
          Gets the prefix resolver.
 java.lang.String onPrepareStatement(java.lang.String sql)
           
 void setPrefixResolver(PrefixResolver prefixResolver)
          Sets the prefix resolver.
 
Methods inherited from class org.hibernate.EmptyInterceptor
afterTransactionBegin, afterTransactionCompletion, beforeTransactionCompletion, findDirty, getEntity, getEntityName, instantiate, isTransient, onCollectionRecreate, onCollectionRemove, onCollectionUpdate, onDelete, onFlushDirty, onLoad, onSave, postFlush, preFlush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX_PLACEHOLDER

public static java.lang.String PREFIX_PLACEHOLDER
The PREFI x_ placeholder.

Constructor Detail

PrefixInterceptor

public PrefixInterceptor()
Instantiates a new prefix interceptor.


PrefixInterceptor

public PrefixInterceptor(PrefixResolver prefixResolver)
Instantiates a new prefix interceptor.

Parameters:
prefixResolver - the prefix resolver
Method Detail

onPrepareStatement

public java.lang.String onPrepareStatement(java.lang.String sql)
Specified by:
onPrepareStatement in interface org.hibernate.Interceptor
Overrides:
onPrepareStatement in class org.hibernate.EmptyInterceptor

setPrefixResolver

public void setPrefixResolver(PrefixResolver prefixResolver)
Sets the prefix resolver.

Parameters:
prefixResolver - the new prefix resolver

getPrefixResolver

public PrefixResolver getPrefixResolver()
Gets the prefix resolver.

Returns:
the prefix resolver

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.