com.konakart.app
Class KKDbMapMgr

java.lang.Object
  extended by com.konakart.app.KKDbMapMgr

public class KKDbMapMgr
extends java.lang.Object

This is a manager for manipulating the Torque dbMaps


Field Summary
protected static org.apache.commons.logging.Log log
          the log
 
Constructor Summary
KKDbMapMgr(DbPortabilityIf portRules)
          Constructor
 
Method Summary
 org.apache.torque.map.DatabaseMap getDbMap()
           
static java.util.HashMap<java.lang.String,java.lang.String> getDbObjectNamesReverseHash()
           
static java.lang.String getOriginalColumn(java.lang.String standardCol)
          Return a "non-standardised" column name.
static java.lang.String getStandardColumn(java.lang.String oldCol)
          Return a "standardised" column name.
 void standardiseNames()
          Runs through the internal Torque structures and ensures that the database table, column and sequence names are "standardised" according to the rules of the database that is currently being used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log

Constructor Detail

KKDbMapMgr

public KKDbMapMgr(DbPortabilityIf portRules)
Constructor

Parameters:
portRules - a class that implements the "portability rules" for the current database
Method Detail

standardiseNames

public void standardiseNames()
                      throws KKException
Runs through the internal Torque structures and ensures that the database table, column and sequence names are "standardised" according to the rules of the database that is currently being used.

Throws:
KKException

getStandardColumn

public static java.lang.String getStandardColumn(java.lang.String oldCol)
Return a "standardised" column name. Due to various limitations of some databases (eg. Oracle only allows 30-char table and column names) we sometimes have to shorten the column names. We call this shortening "standardisation".

Parameters:
oldCol -
Returns:
a standardised column name which will be appropriate for the current database.

getOriginalColumn

public static java.lang.String getOriginalColumn(java.lang.String standardCol)
Return a "non-standardised" column name. Due to various limitations of some databases (eg. Oracle only allows 30-char table and column names) we sometimes have to shorten the column names. We call this shortening "standardisation". This returns the original column name for the possibly standardised column.

Parameters:
standardCol -
Returns:
a non-standardised column name which will be appropriate for the current database.

getDbMap

public org.apache.torque.map.DatabaseMap getDbMap()
                                           throws org.apache.torque.TorqueException
Returns:
the dbMap.
Throws:
org.apache.torque.TorqueException

getDbObjectNamesReverseHash

public static java.util.HashMap<java.lang.String,java.lang.String> getDbObjectNamesReverseHash()
Returns:
Returns the dbObjectNamesReverseHash.


Copyright © 2011 DS Data Systems UK Ltd.