Last update: 2011-06-23

org.proteios.core
Interface UpdateToSchemaVersionInterface

All Known Implementing Classes:
AbstractUpdateToSchemaVersion, UpdateToSchemaVersion10, UpdateToSchemaVersion2, UpdateToSchemaVersion3, UpdateToSchemaVersion4, UpdateToSchemaVersion5, UpdateToSchemaVersion6, UpdateToSchemaVersion7, UpdateToSchemaVersion8, UpdateToSchemaVersion9, UpdateToSchemaVersionTmpl

public interface UpdateToSchemaVersionInterface

This interface describes methods used to perform incremental update from previous schema version to the version the class corresponds to. Based on BASE2 class src/core/net/sf/basedb/core/Update.java, but adapted to use a main updater class that performs a general update by calling methods in classes that perform an incremental update from one version to the next.

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

Method Summary
 int adjustExistingItems(org.hibernate.Session session)
          Adjust the existing items in the database to be compatible with the latest mappings.
 int update(org.hibernate.Session session)
          Update the database by modifying existing items to follow new requirements.
 

Method Detail

update

int update(org.hibernate.Session session)
           throws BaseException
Update the database by modifying existing items to follow new requirements. Performs updates between the previous schema version and the version the class corresponds to.

Parameters:
session - org.hibernate.Session a Hibernate session to use for transactions.
Returns:
int the schema version this class updates to.
Throws:
BaseException

adjustExistingItems

int adjustExistingItems(org.hibernate.Session session)
                        throws BaseException
Adjust the existing items in the database to be compatible with the latest mappings. No update to the schema version should be done here. The code must also consider the case that the update fails at a later stage and that the same update is executed again.

Parameters:
session - org.hibernate.Session the Hibernate session to use.
Returns:
int The number of affected items.
Throws:
BaseException

Last update: 2011-06-23