org.opensubsystems.inventory.persist.db
Class ItemUnitViewDatabaseSchema

java.lang.Object
  extended by org.opensubsystems.core.persist.db.DatabaseSchemaImpl
      extended by org.opensubsystems.patterns.listdata.persist.db.impl.ListDatabaseSchemaImpl
          extended by org.opensubsystems.inventory.persist.db.ItemUnitViewDatabaseSchema
All Implemented Interfaces:
org.opensubsystems.core.persist.db.DatabaseOperations, org.opensubsystems.core.persist.db.DatabaseSchema, org.opensubsystems.patterns.listdata.persist.db.ListDatabaseSchema

public class ItemUnitViewDatabaseSchema
extends org.opensubsystems.patterns.listdata.persist.db.impl.ListDatabaseSchemaImpl

Database specific operations related to retrieval of combined items and units.

Version:
$Id: ItemUnitViewDatabaseSchema.java,v 1.9 2007/01/12 06:19:45 bastafidli Exp $
Author:
Martin Cerba
Code reviewer:
TODO: Review this code
Code reviewed:

Field Summary
static java.lang.String ITEM_UNIT_VIEW_SCHEMA_NAME
          Name identifies this schema in the database.
static int ITEM_UNIT_VIEW_SCHEMA_VERSION
          Version of this schema in the database.
static int[] ITEMUNIT_MANDATORY_RETRIEVE_COLUMNS
          Columns which always have to be retrieved from the database
static int[] ITEMUNIT_SORT_COLUMNS
          Static variable for array of all columns codes that can be used for sorting.
static java.lang.String[] OWNER_ITEM_UNIT_VIEW_COLUMN_NAMES
          Owner column names string array.
 
Fields inherited from class org.opensubsystems.patterns.listdata.persist.db.impl.ListDatabaseSchemaImpl
m_mapFilterableColumns, m_mapListableTableNames, m_mapMandatoryRetrieveColumns, m_mapSortableColumns
 
Fields inherited from class org.opensubsystems.core.persist.db.DatabaseSchemaImpl
DATABASE_SCHEMA_PREFIX, DATABASE_SCHEMA_PREFIX_DEFAULT, m_arrDependentSchemas, m_bIsInDomain, m_iSchemaVersion, m_strSchemaName, NL
 
Fields inherited from interface org.opensubsystems.core.persist.db.DatabaseOperations
DBOP_DELETE, DBOP_INSERT, DBOP_SELECT, DBOP_UPDATE
 
Constructor Summary
ItemUnitViewDatabaseSchema()
          Default constructor.
 
Method Summary
 void create(java.sql.Connection cntDBConnection, java.lang.String strUserName)
          Create the schema.
static java.lang.String getColumn(int iColumnId)
          Get name for specified column code or null if the column is not recognized.
 java.lang.StringBuffer getColumns(boolean specific, int[] columns, java.lang.Object[] prefixes, java.lang.Object[] postfixes, java.lang.StringBuffer buffer)
          
 java.lang.String[] getJoinFromWhere(java.util.List conditions, int[] columns)
          
 java.lang.String getSelectItemUnitViewById(int[] columns)
          Get query to retrieve item unit view by id
 
Methods inherited from class org.opensubsystems.patterns.listdata.persist.db.impl.ListDatabaseSchemaImpl
getFilterbleColumns, getMandatoryRetrieveColumns, getSelectList, getSortableColumns
 
Methods inherited from class org.opensubsystems.core.persist.db.DatabaseSchemaImpl
getDependentSchemas, getName, getOwnerColumnNames, getSchemaPrefix, getVersion, handleSQLException, isExistingIndex, isInDomain, upgrade, upgradeView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensubsystems.patterns.listdata.persist.db.ListDatabaseSchema
isExistingIndex
 
Methods inherited from interface org.opensubsystems.core.persist.db.DatabaseSchema
getDependentSchemas, getName, getVersion, handleSQLException, isInDomain, upgrade
 

Field Detail

ITEM_UNIT_VIEW_SCHEMA_NAME

public static final java.lang.String ITEM_UNIT_VIEW_SCHEMA_NAME
Name identifies this schema in the database.

See Also:
Constant Field Values

ITEM_UNIT_VIEW_SCHEMA_VERSION

public static final int ITEM_UNIT_VIEW_SCHEMA_VERSION
Version of this schema in the database.

See Also:
Constant Field Values

OWNER_ITEM_UNIT_VIEW_COLUMN_NAMES

public static final java.lang.String[] OWNER_ITEM_UNIT_VIEW_COLUMN_NAMES
Owner column names string array.


ITEMUNIT_MANDATORY_RETRIEVE_COLUMNS

public static final int[] ITEMUNIT_MANDATORY_RETRIEVE_COLUMNS
Columns which always have to be retrieved from the database


ITEMUNIT_SORT_COLUMNS

public static final int[] ITEMUNIT_SORT_COLUMNS
Static variable for array of all columns codes that can be used for sorting.

Constructor Detail

ItemUnitViewDatabaseSchema

public ItemUnitViewDatabaseSchema()
                           throws org.opensubsystems.core.error.OSSException
Default constructor.

Throws:
org.opensubsystems.core.error.OSSException - - error occured.
Method Detail

getSelectItemUnitViewById

public java.lang.String getSelectItemUnitViewById(int[] columns)
                                           throws org.opensubsystems.core.error.OSSException
Get query to retrieve item unit view by id

Parameters:
columns - - columns to retrieve
Returns:
String - query
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getColumns

public java.lang.StringBuffer getColumns(boolean specific,
                                         int[] columns,
                                         java.lang.Object[] prefixes,
                                         java.lang.Object[] postfixes,
                                         java.lang.StringBuffer buffer)
                                  throws org.opensubsystems.core.error.OSSException

Throws:
org.opensubsystems.core.error.OSSException

getColumn

public static java.lang.String getColumn(int iColumnId)
Get name for specified column code or null if the column is not recognized.

Parameters:
iColumnId - - column code to get the name for
Returns:
String - column name or null if the column is not recognized

getJoinFromWhere

public java.lang.String[] getJoinFromWhere(java.util.List conditions,
                                           int[] columns)

Specified by:
getJoinFromWhere in interface org.opensubsystems.patterns.listdata.persist.db.ListDatabaseSchema
Overrides:
getJoinFromWhere in class org.opensubsystems.core.persist.db.DatabaseSchemaImpl

create

public void create(java.sql.Connection cntDBConnection,
                   java.lang.String strUserName)
            throws java.sql.SQLException
Create the schema.

Parameters:
cntDBConnection - - valid connection to database
strUserName - - name of user who will be accessing this table
Throws:
java.sql.SQLException - - an error while creating schema


Copyright © 2003 - 2006 OpenSubsystems s.r.o.