com.sibvisions.rad.server.config
Class DBObjects

java.lang.Object
  extended by com.sibvisions.rad.server.config.DBObjects

public final class DBObjects
extends java.lang.Object

The DBObjects class declares global accessible names for database objects.


Method Summary
static java.lang.String getColumnName(IConfiguration pConfig, java.lang.String pTable, java.lang.String pColumn)
          Gets the name of a column, as it is in the database.
static java.lang.String getTableName(IConfiguration pConfig, java.lang.String pTable)
          Gets the name of a table, as it is in the database.
static java.lang.String getYesValue(IConfiguration pConfig)
          Gets the yes value for yes/no fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTableName

public static java.lang.String getTableName(IConfiguration pConfig,
                                            java.lang.String pTable)
                                     throws java.lang.Exception
Gets the name of a table, as it is in the database. The name can be configured in the application configuration with the following option: <application> <databaseobjects> <TABLENAME>newname</TABLENAME> </databaseobjects> </application>

Parameters:
pConfig - the application configuration
pTable - the table alias
Returns:
the table name or null if the table is not available
Throws:
java.lang.Exception - if the application configuration is invalid

getColumnName

public static java.lang.String getColumnName(IConfiguration pConfig,
                                             java.lang.String pTable,
                                             java.lang.String pColumn)
                                      throws java.lang.Exception
Gets the name of a column, as it is in the database. The name can be configured in the application configuration with the following option: <application> <databaseobjects> <TABLENAME_COLUMNNAME>newname</TABLENAME_COLUMNNAME> </databaseobjects> </application>

Parameters:
pConfig - the application configuration
pTable - the table alias
pColumn - the column alias
Returns:
the column name or null if the column is not available
Throws:
java.lang.Exception - if the application configuration is invalid

getYesValue

public static java.lang.String getYesValue(IConfiguration pConfig)
                                    throws java.lang.Exception
Gets the yes value for yes/no fields. The value can be configured in the application configuration with following option: <application> <databaseobjects> <yesvalue>X</yesvalue> </databaseobjects> </application>

Parameters:
pConfig - the application configuration
Returns:
the configured yes value for yes/no columns or DEFAULT_YESVALUE value if the value is not configured.
Throws:
java.lang.Exception - if the application configuration is invalid


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.