org.olat.core.commons.persistence
Class DatabaseSetup

java.lang.Object
  extended by org.olat.core.commons.persistence.DatabaseSetup

public class DatabaseSetup
extends java.lang.Object

Initial Date: 25.10.2002

Author:
Florian Gnaegi Comment: Use this class to create the initial OLAT database

Constructor Summary
DatabaseSetup()
           
 
Method Summary
static void createTables()
          Setup OLAT database.
static org.hibernate.cfg.Configuration datastoreConfiguration()
          Method datastoreConfiguration is the central mapping definition of all OLAT objects and their mapping to a relational database.
static void dropTables()
          Drop all OLAT tables
static void main(java.lang.String[] args)
          Execute commands from the command line: 'setup' or 'drop' currently available
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseSetup

public DatabaseSetup()
Method Detail

datastoreConfiguration

public static org.hibernate.cfg.Configuration datastoreConfiguration()
                                                              throws org.hibernate.MappingException
Method datastoreConfiguration is the central mapping definition of all OLAT objects and their mapping to a relational database. When a new mapping is accomplished, it has to be added here.

Returns:
Datastore
Throws:
org.hibernate.MappingException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Execute commands from the command line: 'setup' or 'drop' currently available

Parameters:
args - One of createTables, dropTables, toFile, updateDDL
Throws:
java.lang.Exception - e.g. DatabaseSetup org.hibernate.dialect.MySQLDialect createScript

createTables

public static void createTables()
                         throws java.lang.Exception
Setup OLAT database. This will drop all tables first if available.

Throws:
java.lang.Exception

dropTables

public static void dropTables()
                       throws java.lang.Exception
Drop all OLAT tables

Throws:
java.lang.Exception