Last update: 2011-06-23

org.proteios.core
Class SchemaVersion

java.lang.Object
  extended by org.proteios.core.SchemaVersion

public class SchemaVersion
extends Object

This class contains methods to get and set the schema version data in the database.

Version:
2.0
Author:
Olle
Last modified
$Date: 2007-02-06 10:14:33Z $

Constructor Summary
SchemaVersion()
           
 
Method Summary
static int getApplicationBuild(org.hibernate.Session session)
          Get the current application build number as it is stored in the database.
static int getSchemaVersion()
           
static int getSchemaVersion(org.hibernate.Session session)
          Get the current schema version number as it is stored in the database.
static void setSchemaVersion(org.hibernate.Session session, int schemaVersion)
          Update the database with a new schema version number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaVersion

public SchemaVersion()
Method Detail

getApplicationBuild

public static int getApplicationBuild(org.hibernate.Session session)
                               throws BaseException
Get the current application build number as it is stored in the database.

Parameters:
session - org.hibernate.Session a Hibernate session to use for queries.
Returns:
int The application build number, or 0 if no application build is found
Throws:
BaseException

getSchemaVersion

public static int getSchemaVersion(org.hibernate.Session session)
                            throws BaseException
Get the current schema version number as it is stored in the database.

Parameters:
session - org.hibernate.Session a Hibernate session to use for queries.
Returns:
int The schema version number, or 0 if no schema version is found
Throws:
BaseException

getSchemaVersion

public static int getSchemaVersion()
                            throws BaseException
Throws:
BaseException

setSchemaVersion

public static void setSchemaVersion(org.hibernate.Session session,
                                    int schemaVersion)
                             throws BaseException
Update the database with a new schema version number. This method should be called from an open transaction.

Parameters:
session - org.hibernate.Session a Hibernate session to use for queries.
schemaVersion - int The new schema version number
Throws:
BaseException

Last update: 2011-06-23