org.opensubsystems.core.persist.db.postgresql
Class PostgreSQLVersionedDatabaseSchema
java.lang.Object
org.opensubsystems.core.persist.db.DatabaseSchemaImpl
org.opensubsystems.core.persist.db.VersionedDatabaseSchema
org.opensubsystems.core.persist.db.postgresql.PostgreSQLVersionedDatabaseSchema
- All Implemented Interfaces:
- DatabaseOperations, DatabaseSchema
public class PostgreSQLVersionedDatabaseSchema
- extends VersionedDatabaseSchema
PostgreSQL versioned database schema provide functionality of creating
and upgrading of Postgre SQL database schemas in the database based on
their versions.
This class keeps track of existing and current versiones of PostgreSQL
database schemas and upgrades them as necesary
- Version:
- $Id: PostgreSQLVersionedDatabaseSchema.java,v 1.7 2007/01/07 06:14:43 bastafidli Exp $
- Author:
- Julo Legeny
- Code reviewer:
- Miro Halas
- Code reviewed:
- 1.3 2004/12/18 06:18:37 bastafidli
|
Method Summary |
void |
create(java.sql.Connection cntDBConnection,
java.lang.String strUserName)
Create the schema. |
protected void |
createUserDefinedType(java.sql.Connection cntDBConnection,
java.lang.String strUserName)
Create user defined type that stores return values (generated id and timestamp)
from stored procedures. |
void |
loadExistingSchemas(java.sql.Connection cntDBConnection,
java.util.Map mpSchemasToAdd,
java.util.Map mpSchemasToUpgrade)
Check what schemas already exists in the repository. |
void |
upgrade(java.sql.Connection cntDBConnection,
java.lang.String strUserName,
int iOriginalVersion)
Upgrade the schema. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PostgreSQLVersionedDatabaseSchema
public PostgreSQLVersionedDatabaseSchema()
throws OSSException
- Throws:
OSSException - - database cannot be started.
loadExistingSchemas
public void loadExistingSchemas(java.sql.Connection cntDBConnection,
java.util.Map mpSchemasToAdd,
java.util.Map mpSchemasToUpgrade)
throws OSSException
- Check what schemas already exists in the repository.
- Overrides:
loadExistingSchemas in class VersionedDatabaseSchema
- Parameters:
cntDBConnection - - valid connection to databasempSchemasToAdd - - current schemas will at the end contains schemas,
which must be addedmpSchemasToUpgrade - - schemas to upgrade will contain schemas,
which must be upgraded
- Throws:
OSSException - - problem initializing the schema
create
public void create(java.sql.Connection cntDBConnection,
java.lang.String strUserName)
throws java.sql.SQLException,
OSSException
- Create the schema.
- Specified by:
create in interface DatabaseSchema- Overrides:
create in class VersionedDatabaseSchema
- Parameters:
cntDBConnection - - valid connection to databasestrUserName - - name of user who will be accessing this table
- Throws:
java.sql.SQLException - - problem creating the schema
OSSException - - problem creating the schema
upgrade
public void upgrade(java.sql.Connection cntDBConnection,
java.lang.String strUserName,
int iOriginalVersion)
throws java.sql.SQLException
- Upgrade the schema.
- Specified by:
upgrade in interface DatabaseSchema- Overrides:
upgrade in class DatabaseSchemaImpl
- Parameters:
cntDBConnection - - valid connection to databasestrUserName - - name of user who will be accessing this tableiOriginalVersion - - original version from which to upgrade
- Throws:
java.sql.SQLException - - problem creating the database schema
createUserDefinedType
protected void createUserDefinedType(java.sql.Connection cntDBConnection,
java.lang.String strUserName)
throws java.sql.SQLException
- Create user defined type that stores return values (generated id and timestamp)
from stored procedures.
- Parameters:
cntDBConnection - - database connectionstrUserName - - user name
- Throws:
java.sql.SQLException - - exception occured during creating user defined type
Copyright © 2003 - 2006 OpenSubsystems s.r.o.