toolbox.dao.orm
Class ORMMappingConfig

Package class diagram package ORMMappingConfig
java.lang.Object
  extended by toolbox.dao.orm.ORMMappingConfig

 class ORMMappingConfig
extends java.lang.Object

Package protected class to encapsulate the configuration of a Mapping for the default ORMQueryService implementation.


Constructor Summary
ORMMappingConfig(java.lang.String ormConf, XMLProperties props, org.w3c.dom.Element mappingEl, java.util.Map settings)
          Construct a new instance with the provided XML configuration and ORM settings.
 
Method Summary
(package private)  java.lang.Class getDaoBeanClass()
          Return a Class instance of the DaoBean implementation configured for this mapping configuration.
(package private)  java.lang.Object getDaoBeanInstance()
          Return an instance of the DaoBean implementation configured for this mapping configuration.
(package private)  java.lang.String getKey()
          Return the key used to identify an entity in the table.
(package private)  java.lang.String getName()
          Return the name of this mapping configuration.
(package private)  java.util.List getReferenceIds()
          Return a List of the reference identifiers configured for this mapping configuration.
(package private)  java.util.List getReferences()
          Return the List of ORMReferenceConfig instances configured for this mapping configuration.
(package private)  java.lang.String getSelectAll()
          Return the SQL statement that must be used to obtain all entities and resolve all references.
(package private)  java.lang.String getSelectOne()
          Return the SQL statement that must be used to obtain a single entity and resolve all references for the entity.
(package private)  java.lang.String getSelectRefs()
          Return the SQL statement that must be used to obtain referenced entity instances.
(package private)  java.lang.String getTable()
          Return the table of this mapping configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ORMMappingConfig

ORMMappingConfig(java.lang.String ormConf,
                 XMLProperties props,
                 org.w3c.dom.Element mappingEl,
                 java.util.Map settings)
           throws ConfException
Construct a new instance with the provided XML configuration and ORM settings.

Parameters:
ormConf - String containing the name of the ORM configuration that this mapping belongs to.
props - XMLProperties instance.
mappingEl - Element containing mapping configuration.
settings - Map containing ORM configuration settings. This implementation only supports one setting:
  • aliases [true|false]: Indicates whether to use aliases for tables when generating SQL.
Throws:
ConfException - if the the mapping configuration cannot be initialised.
Method Detail

getName

java.lang.String getName()
Return the name of this mapping configuration.

Returns:
String containing the name of the mapping configuration.

getTable

java.lang.String getTable()
Return the table of this mapping configuration.

Returns:
String containing the table of this mapping configuration.

getKey

java.lang.String getKey()
Return the key used to identify an entity in the table.

Returns:
String containing the key of this mapping configuration.

getDaoBeanInstance

java.lang.Object getDaoBeanInstance()
                              throws java.lang.Exception
Return an instance of the DaoBean implementation configured for this mapping configuration.

Returns:
Object that is a DaoBean instance.
Throws:
java.lang.Exception - if the DaoBean instance cannot be returned.

getDaoBeanClass

java.lang.Class getDaoBeanClass()
                          throws java.lang.Exception
Return a Class instance of the DaoBean implementation configured for this mapping configuration.

Returns:
Class that is a DaoBean implementation.
Throws:
java.lang.Exception - if the DaoBean class cannot be returned.

getReferences

java.util.List getReferences()
Return the List of ORMReferenceConfig instances configured for this mapping configuration.

Returns:
List containing ORMReferenceConfig instances.

getReferenceIds

java.util.List getReferenceIds()
Return a List of the reference identifiers configured for this mapping configuration.

Returns:
List containing the referenced identifiers for this mapping configuration

getSelectAll

java.lang.String getSelectAll()
Return the SQL statement that must be used to obtain all entities and resolve all references.

Returns:
String containing the SQL statement.

getSelectOne

java.lang.String getSelectOne()
Return the SQL statement that must be used to obtain a single entity and resolve all references for the entity.

Returns:
String containing the SQL statement.

getSelectRefs

java.lang.String getSelectRefs()
Return the SQL statement that must be used to obtain referenced entity instances.

Returns:
String containing the SQL statement.