wt.dataservice
Class DatastoreUtilities

java.lang.Object
  extended bywt.dataservice.DatastoreUtilities

public class DatastoreUtilities
extends Object

Utility methods needed for both runtime and generation.


Field Summary
static String COMPUTED_COLUMN_NAME_PREFIX
           
private static String COMPUTED_COLUMN_NAME_SEPERATOR
           
private static String COMPUTED_COLUMN_NAME_UNIQUE
           
static String UNIQUE_COMPUTED_COLUMN_NAME_SUFFFIX
           
 
Constructor Summary
DatastoreUtilities()
           
 
Method Summary
static String getComputedColumnName(int a_indexOffset, int a_indexColumnOffset, boolean a_isUnique)
          This method returns the Computed Column Name for SQLServer Function based index support.
private static List getComputedColumns_composite(String[][] a_indexColumns, boolean a_isUnique, Properties a_properties, String a_keyPrefix)
           
private static List getComputedColumns_unique(BaseTableInfo a_tableInfo, Properties a_properties, String a_keyPrefix)
           
static ColumnDescriptor[] getComputedColumns(BaseTableInfo a_tableInfo, Properties a_properties, String a_keyPrefix)
          This method returns the ColumnDescriptor[] for computed columns required for SqlServer Unique and Function based index support.
static ColumnDescriptor[] getComputedColumns(Class a_class)
           
static List getComputedColumns(String[][] a_indexColumns, boolean a_isUnique, Properties a_properties, String a_keyPrefix)
           
static String[][] getNonUniqueIndices(BaseTableInfo a_baseTableInfo)
          This method returns all the non-unique indexes expression.
static String getUniqueComputedColumnName(BaseTableInfo a_tableInfo, String columnNameExpression, boolean a_isUnique)
          This method returns the Computed Column Name for SQLServer unique index support.
static String[][] getUniqueIndices(BaseTableInfo a_baseTableInfo)
          This method returns all the unique indexes expression.
static boolean isDatastoreIdentifier(String a_string)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPUTED_COLUMN_NAME_PREFIX

public static final String COMPUTED_COLUMN_NAME_PREFIX
See Also:
Constant Field Values

COMPUTED_COLUMN_NAME_SEPERATOR

private static final String COMPUTED_COLUMN_NAME_SEPERATOR
See Also:
Constant Field Values

COMPUTED_COLUMN_NAME_UNIQUE

private static final String COMPUTED_COLUMN_NAME_UNIQUE
See Also:
Constant Field Values

UNIQUE_COMPUTED_COLUMN_NAME_SUFFFIX

public static final String UNIQUE_COMPUTED_COLUMN_NAME_SUFFFIX
See Also:
Constant Field Values
Constructor Detail

DatastoreUtilities

public DatastoreUtilities()
Method Detail

getComputedColumnName

public static String getComputedColumnName(int a_indexOffset,
                                           int a_indexColumnOffset,
                                           boolean a_isUnique)
This method returns the Computed Column Name for SQLServer Function based index support.

Supported API: false

Returns:
java.lang.String Computed Column Name

getUniqueComputedColumnName

public static String getUniqueComputedColumnName(BaseTableInfo a_tableInfo,
                                                 String columnNameExpression,
                                                 boolean a_isUnique)
This method returns the Computed Column Name for SQLServer unique index support.

Supported API: false

Parameters:
a_tableInfo - BaseTableInfo
Returns:
java.lang.String Computed Column Name

getComputedColumns

public static ColumnDescriptor[] getComputedColumns(BaseTableInfo a_tableInfo,
                                                    Properties a_properties,
                                                    String a_keyPrefix)
                                             throws WTException
This method returns the ColumnDescriptor[] for computed columns required for SqlServer Unique and Function based index support.

Supported API: false

Parameters:
a_tableInfo - a BaseTableInfo
a_properties - wt.util.Properties
a_keyPrefix - a keyPrefix for pproperties
Returns:
wt.introspection.ColumnDescriptor[] for computed columns.
Throws:
WTException

getComputedColumns_unique

private static List getComputedColumns_unique(BaseTableInfo a_tableInfo,
                                              Properties a_properties,
                                              String a_keyPrefix)
                                       throws WTException
Throws:
WTException

getComputedColumns_composite

private static List getComputedColumns_composite(String[][] a_indexColumns,
                                                 boolean a_isUnique,
                                                 Properties a_properties,
                                                 String a_keyPrefix)

getNonUniqueIndices

public static String[][] getNonUniqueIndices(BaseTableInfo a_baseTableInfo)
                                      throws WTException
This method returns all the non-unique indexes expression. It includes expressions for Composite indexes and ColumnDescriptor based non-unique indexes.

Supported API: false

Parameters:
a_baseTableInfo - a BaseTableInfo
Returns:
String[][] of non-unique index expressions.
Throws:
WTException

getUniqueIndices

public static String[][] getUniqueIndices(BaseTableInfo a_baseTableInfo)
                                   throws WTException
This method returns all the unique indexes expression. It includes expressions for Composite uniques indexes and ColumnDescriptor based unique indexes.

Supported API: false

Parameters:
a_baseTableInfo - a BaseTableInfo
Returns:
String[][] of Unique index expressions.
Throws:
WTException

getComputedColumns

public static ColumnDescriptor[] getComputedColumns(Class a_class)
                                             throws WTException
Throws:
WTException

getComputedColumns

public static List getComputedColumns(String[][] a_indexColumns,
                                      boolean a_isUnique,
                                      Properties a_properties,
                                      String a_keyPrefix)

isDatastoreIdentifier

public static boolean isDatastoreIdentifier(String a_string)