org.LexGrid.LexBIG.caCore.connection.orm.interceptors
Class EVSHibernateInterceptor

java.lang.Object
  extended by org.hibernate.EmptyInterceptor
      extended by org.LexGrid.LexBIG.caCore.connection.orm.interceptors.EVSHibernateInterceptor
All Implemented Interfaces:
Serializable, org.hibernate.Interceptor

public class EVSHibernateInterceptor
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
private static String CODING_SCHEME_NAME_PLACEHOLDER
           
private  String codingSchemeName
           
private static String ENTITY_CODE_NAMESPACE_PLACEHOLDER
           
private static String EQUALS
           
private static String LIKE
           
private static String LIKE_OR_EQUALS_PLACEHOLDER
           
private static org.apache.log4j.Logger log
           
private  String prefix
           
private static String PREFIX_PLACEHOLDER
           
protected  org.hibernate.Session session
           
private static String WILDCARD
           
 
Fields inherited from class org.hibernate.EmptyInterceptor
INSTANCE
 
Constructor Summary
EVSHibernateInterceptor()
           
 
Method Summary
 String getCodingSchemeName()
           
 String getPrefix()
           
 String onPrepareStatement(String sql)
           
 void setCodingSchemeName(String codingSchemeName)
           
 void setPrefix(String prefix)
           
 
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

log

private static org.apache.log4j.Logger log

session

protected org.hibernate.Session session

prefix

private String prefix

codingSchemeName

private String codingSchemeName

PREFIX_PLACEHOLDER

private static final String PREFIX_PLACEHOLDER
See Also:
Constant Field Values

CODING_SCHEME_NAME_PLACEHOLDER

private static final String CODING_SCHEME_NAME_PLACEHOLDER
See Also:
Constant Field Values

ENTITY_CODE_NAMESPACE_PLACEHOLDER

private static final String ENTITY_CODE_NAMESPACE_PLACEHOLDER
See Also:
Constant Field Values

LIKE_OR_EQUALS_PLACEHOLDER

private static final String LIKE_OR_EQUALS_PLACEHOLDER
See Also:
Constant Field Values

WILDCARD

private static final String WILDCARD
See Also:
Constant Field Values

LIKE

private static final String LIKE
See Also:
Constant Field Values

EQUALS

private static final String EQUALS
See Also:
Constant Field Values
Constructor Detail

EVSHibernateInterceptor

public EVSHibernateInterceptor()
Method Detail

onPrepareStatement

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

getCodingSchemeName

public String getCodingSchemeName()

setCodingSchemeName

public void setCodingSchemeName(String codingSchemeName)

getPrefix

public String getPrefix()

setPrefix

public void setPrefix(String prefix)