ru.pan.magpie
Class Configuration

java.lang.Object
  extended by ru.pan.magpie.Configuration

public class Configuration
extends java.lang.Object


Constructor Summary
Configuration(java.lang.String configFileName)
          Creates a new oracle-magpie Configuration instance.
Configuration(java.lang.String configFileName, javax.sql.DataSource ds)
          Creates a new oracle-magpie Configuration instance.
 
Method Summary
 javax.sql.DataSource getDataSource()
          Returns data source object currently using by the library
 java.lang.Object getObjectTypeProxy(java.lang.Class clazz, java.lang.Object baseObject)
          Create a new instance of the oracle object type proxy for the java class instance mapped to this type
 java.lang.Object getPackageProxy(java.lang.Class clazz)
          Creates a new instance of the oracle package proxy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration(java.lang.String configFileName)
              throws java.sql.SQLException,
                     ru.pan.magpie.exceptions.InitConfigurationException
Creates a new oracle-magpie Configuration instance. The instance initialization includes loading of all user-defined type and interface mappings from xml-configuration files and annotations. The mappings are checked for completeness and correctness. Data source must be defined in the configuration file.

Parameters:
configFileName - file name of the main xml configuration file
Throws:
java.sql.SQLException
ru.pan.magpie.exceptions.InitConfigurationException

Configuration

public Configuration(java.lang.String configFileName,
                     javax.sql.DataSource ds)
              throws java.sql.SQLException,
                     ru.pan.magpie.exceptions.InitConfigurationException
Creates a new oracle-magpie Configuration instance. The instance initialization includes loading of all user-defined type and interface mappings from the xml-configuration files and annotations. The mappings are checked for completeness and correctness.

Parameters:
configFileName - file name of the main xml configuration file
ds - data source, this argument value overwrites configuration element value
Throws:
java.sql.SQLException
ru.pan.magpie.exceptions.InitConfigurationException
Method Detail

getDataSource

public javax.sql.DataSource getDataSource()
Returns data source object currently using by the library

Returns:
data source

getObjectTypeProxy

public java.lang.Object getObjectTypeProxy(java.lang.Class clazz,
                                           java.lang.Object baseObject)
                                    throws ru.pan.magpie.exceptions.ProxyCreationException
Create a new instance of the oracle object type proxy for the java class instance mapped to this type

Parameters:
clazz - interface mapped to the required oracle object type
baseObject - instance of the entity class, proxy base
Returns:
proxy instance
Throws:
ru.pan.magpie.exceptions.ProxyCreationException

getPackageProxy

public java.lang.Object getPackageProxy(java.lang.Class clazz)
                                 throws ru.pan.magpie.exceptions.ProxyCreationException
Creates a new instance of the oracle package proxy

Parameters:
clazz - interface mapped to the required oracle package
Returns:
proxy instance
Throws:
ru.pan.magpie.exceptions.ProxyCreationException