biz.c24.io.api.data
Class DatabaseSourcedEnumeration

java.lang.Object
  extended by biz.c24.io.api.data.SourcedEnumeration
      extended by biz.c24.io.api.data.DatabaseSourcedEnumeration
All Implemented Interfaces:
Enumeration, ModelComponent, Validator, Serializable

public class DatabaseSourcedEnumeration
extends SourcedEnumeration

An enumeration sourced from a database. NOTE: Please ensure that the Hibernate & required 3rd party libraries added to your classpath (hibernate3.jar etc.). For more information about the Hibernate please visit: http://www.hibernate.org/

See Also:
Serialized Form

Constructor Summary
DatabaseSourcedEnumeration(String rootClassName, org.hibernate.cfg.Configuration configuration, XPathStatement xpath, boolean trim, ClassLoader classLoader, String primaryKey, String sqlQuery, String hqlQuery)
          Deprecated. Use DatabaseSourcedEnumeration(String, org.hibernate.cfg.Configuration, XPathStatement, boolean, ClassLoader, String, String, String, String) instead
DatabaseSourcedEnumeration(String rootClassName, org.hibernate.cfg.Configuration configuration, XPathStatement xpath, boolean trim, ClassLoader classLoader, String primaryKey, String sqlQuery, String hqlQuery, String hibernateDialect)
          Creates a new enumeration which will connect and retrieve data via the specified Hibernate configuration.
 
Method Summary
 org.hibernate.cfg.Configuration getConfiguration()
          Reutrn the Hibernate configuration.
 String getErrorCode()
          Returns the error code for this enumeration.
 String getHQLQuery()
          Returns the HQL query.
 String getPrimaryKey()
          Returns the primary key.
 String getSQLQuery()
          Returns the SQL query.
 
Methods inherited from class biz.c24.io.api.data.SourcedEnumeration
getAnnotation, getAnnotation, getClassLoader, getCount, getIndex, getName, getName, getRootClassName, getSource, getValue, getXPath, init, isErrored, isInitialized, isTrim, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatabaseSourcedEnumeration

public DatabaseSourcedEnumeration(String rootClassName,
                                  org.hibernate.cfg.Configuration configuration,
                                  XPathStatement xpath,
                                  boolean trim,
                                  ClassLoader classLoader,
                                  String primaryKey,
                                  String sqlQuery,
                                  String hqlQuery)
Deprecated. Use DatabaseSourcedEnumeration(String, org.hibernate.cfg.Configuration, XPathStatement, boolean, ClassLoader, String, String, String, String) instead


DatabaseSourcedEnumeration

public DatabaseSourcedEnumeration(String rootClassName,
                                  org.hibernate.cfg.Configuration configuration,
                                  XPathStatement xpath,
                                  boolean trim,
                                  ClassLoader classLoader,
                                  String primaryKey,
                                  String sqlQuery,
                                  String hqlQuery,
                                  String hibernateDialect)
Creates a new enumeration which will connect and retrieve data via the specified Hibernate configuration.

Parameters:
rootClassName - The name of the root class.
configuration - The Hibernate configuration.
xpath - An XPath statement which extracts the enumeration data from the returned values.
trim - Whether to trim whitespace from the enumeration values.
classLoader - The class loader to use to load the root class and content of the database.
primaryKey - The primary key which selects the value to returned.
sqlQuery - A SQL query to select the value to be returned.
hqlQuery - An HQL query to select the value to be returned.
Throws:
IllegalArgumentException - If the primary key, SQL query and HQL query are all null.
NullPointerException - If the Hibernate configuration is null.
Method Detail

getConfiguration

public org.hibernate.cfg.Configuration getConfiguration()
Reutrn the Hibernate configuration.

Returns:
The configuration.

getPrimaryKey

public String getPrimaryKey()
Returns the primary key.

Returns:
The primary key.

getSQLQuery

public String getSQLQuery()
Returns the SQL query.

Returns:
The SQL query.

getHQLQuery

public String getHQLQuery()
Returns the HQL query.

Returns:
The HQL query.

getErrorCode

public String getErrorCode()
Description copied from interface: Enumeration
Returns the error code for this enumeration.

Returns:
The error code.


C24 Technologies © 2002-2012: All Rights Reserved.