sf logo

sf.qof.customizer
Class SessionContextConnectionFactoryCustomizer

java.lang.Object
  extended by sf.qof.customizer.SessionContextConnectionFactoryCustomizer
All Implemented Interfaces:
ConnectionFactoryCustomizer

public class SessionContextConnectionFactoryCustomizer
extends Object
implements ConnectionFactoryCustomizer

Provides the implementation of a ConnectionFactoryCustomizer to use the SessionContextFactory. This customizer implements getConnection() and setConnection() methods. It delegates calls to getConnection() to SessionContextFactory.getContext().getConnection(). Calls to setConnection() throws a RuntimeException. The UseSessionContext annotation indicates that this customizer should be used and allows to specify a session context name.

See Also:
SessionContextFactory, UseSessionContext

Constructor Summary
SessionContextConnectionFactoryCustomizer()
           
 
Method Summary
 void emitFields(Class<?> queryDefinitionClass, Class<?> superClass, net.sf.cglib.core.ClassEmitter ce)
          This method can add fields to the generated query object if needed by the getConnection() and setConnection() implementation.
 void emitGetConnection(Class<?> queryDefinitionClass, Class<?> superClass, net.sf.cglib.core.ClassEmitter ce)
          This method must implement the getConnection() method as specified in the BaseQuery interface.
 void emitSetConnection(Class<?> queryDefinitionClass, Class<?> superClass, net.sf.cglib.core.ClassEmitter ce)
          This method must implement the setConnection() method as specified in the BaseQuery interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionContextConnectionFactoryCustomizer

public SessionContextConnectionFactoryCustomizer()
Method Detail

emitFields

public void emitFields(Class<?> queryDefinitionClass,
                       Class<?> superClass,
                       net.sf.cglib.core.ClassEmitter ce)
Description copied from interface: ConnectionFactoryCustomizer
This method can add fields to the generated query object if needed by the getConnection() and setConnection() implementation.

Specified by:
emitFields in interface ConnectionFactoryCustomizer
Parameters:
queryDefinitionClass - the annotated query definition class
superClass - the super class
ce - the class emitter

emitGetConnection

public void emitGetConnection(Class<?> queryDefinitionClass,
                              Class<?> superClass,
                              net.sf.cglib.core.ClassEmitter ce)
Description copied from interface: ConnectionFactoryCustomizer
This method must implement the getConnection() method as specified in the BaseQuery interface.

Specified by:
emitGetConnection in interface ConnectionFactoryCustomizer
Parameters:
queryDefinitionClass - the annotated query definition class
superClass - the super class
ce - the class emitter
See Also:
BaseQuery.getConnection()

emitSetConnection

public void emitSetConnection(Class<?> queryDefinitionClass,
                              Class<?> superClass,
                              net.sf.cglib.core.ClassEmitter ce)
Description copied from interface: ConnectionFactoryCustomizer
This method must implement the setConnection() method as specified in the BaseQuery interface.

Specified by:
emitSetConnection in interface ConnectionFactoryCustomizer
Parameters:
queryDefinitionClass - the annotated query definition class
superClass - the super class
ce - the class emitter
See Also:
BaseQuery.setConnection(java.sql.Connection)

sf logo

Copyright © 2007 brunella ltd. All Rights Reserved.