net.sf.voruta
Class Db

java.lang.Object
  |
  +--net.sf.voruta.Db

public final class Db
extends java.lang.Object

This class is the most important in Voruta API, It is factory for data access objects

Author:
baliuka

Field Summary
static java.lang.String CACHE_TAG_NAME
           
static java.lang.String FLUSH_TAG_NAME
           
static java.lang.String HANDLER_TAG_NAME
           
static java.lang.String LANGUAGE_TAG_NAME
           
static java.lang.String QUERY_TAG_NAME
           
static java.lang.String UPDATE_TAG_NAME
           
static java.lang.String VORUTA_AUTOTRACE
           
static java.lang.String VORUTA_EXECUTE_PROPERTY
           
static java.lang.String VORUTA_EXPLAIN_PLAN_PREFIX_PROPERTY
           
static java.lang.String VORUTA_RELOAD_PROPERTY
           
 
Method Summary
static void addInterceptor(ProcedureInterceptor i)
           
static void clearCache()
          Clears cache
static void clearCache(java.lang.String name)
          Clears cache
static void close()
          Closes current connection
static void close(java.lang.String name)
          Closes current connection
static void commit()
          commit current connection
static void commit(java.lang.String name)
          commit current connection
static void explain(java.lang.Class cls)
           
static void explain(java.lang.String connectionName, java.lang.Class cls)
           
static void explain(java.lang.String connectionName, java.lang.reflect.Method m)
          Explains query plan for query declared by data access method
static java.lang.Object getProcedures(java.lang.Class cls)
          generates data access class implementation and returns instance with current connetion
static java.lang.Object getProcedures(java.lang.Class cls, java.lang.String connection)
          generates data access class implementation and returns instance with user provided connection and interceptor
static java.lang.String getProperty(java.lang.String name)
          returns global propery by name
static java.lang.String getProperty(java.lang.String name, java.lang.String def)
           
static java.util.Properties getProperties()
          method to read global properties
static void init(ConnectionFactory factory, java.util.Properties properties)
          Configures voruta
static void registerHandlerFactory(java.lang.String name, HandlerFactory factory)
          Registers custon handler
static void registerLanguage(java.lang.String name, net.sf.voruta.LanguageFactory factory)
          registers custom lamguage handler
static java.util.Map registredClasses()
           
static void removeInterceptor(ProcedureInterceptor i)
           
static void rollback()
          rollback current connection
static void rollback(java.lang.String name)
          rollback current connection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VORUTA_EXPLAIN_PLAN_PREFIX_PROPERTY

public static final java.lang.String VORUTA_EXPLAIN_PLAN_PREFIX_PROPERTY

VORUTA_AUTOTRACE

public static final java.lang.String VORUTA_AUTOTRACE

VORUTA_EXECUTE_PROPERTY

public static final java.lang.String VORUTA_EXECUTE_PROPERTY

VORUTA_RELOAD_PROPERTY

public static final java.lang.String VORUTA_RELOAD_PROPERTY

LANGUAGE_TAG_NAME

public static final java.lang.String LANGUAGE_TAG_NAME

UPDATE_TAG_NAME

public static final java.lang.String UPDATE_TAG_NAME

QUERY_TAG_NAME

public static final java.lang.String QUERY_TAG_NAME

CACHE_TAG_NAME

public static final java.lang.String CACHE_TAG_NAME

FLUSH_TAG_NAME

public static final java.lang.String FLUSH_TAG_NAME

HANDLER_TAG_NAME

public static final java.lang.String HANDLER_TAG_NAME
Method Detail

addInterceptor

public static void addInterceptor(ProcedureInterceptor i)

removeInterceptor

public static void removeInterceptor(ProcedureInterceptor i)

init

public static void init(ConnectionFactory factory,
                        java.util.Properties properties)
Configures voruta
Parameters:
factory - Connection factory implementation
properties - Properties to configure Voruta

getProperties

public static java.util.Properties getProperties()
method to read global properties
Returns:
Properties object

getProperty

public static java.lang.String getProperty(java.lang.String name)
returns global propery by name
Parameters:
name - property name
Returns:
property value

getProperty

public static java.lang.String getProperty(java.lang.String name,
                                           java.lang.String def)

registerLanguage

public static void registerLanguage(java.lang.String name,
                                    net.sf.voruta.LanguageFactory factory)
registers custom lamguage handler
Parameters:
name - language id
factory - language factory implementation

registerHandlerFactory

public static void registerHandlerFactory(java.lang.String name,
                                          HandlerFactory factory)
Registers custon handler
Parameters:
name - tag id
factory - handler factory implementation

clearCache

public static void clearCache(java.lang.String name)
Clears cache
Parameters:
name - cache region name

clearCache

public static void clearCache()
Clears cache

commit

public static void commit()
commit current connection

commit

public static void commit(java.lang.String name)
commit current connection
Parameters:
name - Configuration name

rollback

public static void rollback()
rollback current connection

rollback

public static void rollback(java.lang.String name)
rollback current connection
Parameters:
name - Configuration name

close

public static void close()
Closes current connection

close

public static void close(java.lang.String name)
Closes current connection
Parameters:
name - Configuration name

getProcedures

public static java.lang.Object getProcedures(java.lang.Class cls)
generates data access class implementation and returns instance with current connetion
Parameters:
cls - data access class/interface
Returns:
implementation

getProcedures

public static java.lang.Object getProcedures(java.lang.Class cls,
                                             java.lang.String connection)
generates data access class implementation and returns instance with user provided connection and interceptor
Parameters:
cls - data access class/interface
connection - JDBC connection
i - interceptor
Returns:
implementation

registredClasses

public static java.util.Map registredClasses()

explain

public static void explain(java.lang.String connectionName,
                           java.lang.reflect.Method m)
                    throws java.lang.Exception
Explains query plan for query declared by data access method

explain

public static void explain(java.lang.String connectionName,
                           java.lang.Class cls)
                    throws java.lang.Exception

explain

public static void explain(java.lang.Class cls)
                    throws java.lang.Exception


Copyright © 2003-2004 voruta. All Rights Reserved.