com.sibvisions.rad.server.config
Class DBObjects

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

public final class DBObjects
extends Object

The DBObjects class declares global accessible names for database objects.


Method Summary
static String getColumnName(IConfiguration pConfig, String pTable, String pColumn)
          Gets the name of a column, as it is in the database.
static String getTableName(IConfiguration pConfig, String pTable)
          Gets the name of a table, as it is in the database.
static 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 String getTableName(IConfiguration pConfig,
                                  String pTable)
                           throws 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:
Exception - if the application configuration is invalid

getColumnName

public static String getColumnName(IConfiguration pConfig,
                                   String pTable,
                                   String pColumn)
                            throws 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:
Exception - if the application configuration is invalid

getYesValue

public static String getYesValue(IConfiguration pConfig)
                          throws 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:
Exception - if the application configuration is invalid


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.