DB creator service (JDBC implementation)

DB Creator is responsible for database schema creating using a DDL script inside service configuration or in an external file, calling:

org.exoplatform.services.database.jdbc.DBSchemaCreator.createTables(String dsName, String script)

via

org.exoplatform.services.database.jdbc.CreateDBSchemaPlugin component plugin

The configuration example:

<component>
    <key>org.exoplatform.services.database.jdbc.DBSchemaCreator</key>
    <type>org.exoplatform.services.database.jdbc.DBSchemaCreator</type>
    <component-plugins>    
      <component-plugin> 
          <name>jcr.dbschema</name>
          <set-method>addPlugin</set-method>
          <type>org.exoplatform.services.database.jdbc.CreateDBSchemaPlugin</type>
          <init-params>
            <value-param>
              <name>data-source</name>
              <value>jdbcjcr</value>
            </value-param>
            <value-param>
              <name>script-file</name>
              <value>conf/storage/jcr-mjdbc.sql</value>
            </value-param>  
          </init-params>    
          </component-plugin>
  ........

An example of a DDL script:

CREATE TABLE JCR_MITEM(
        ID VARCHAR(255) NOT NULL PRIMARY KEY, 
        VERSION INTEGER NOT NULL, 
        PATH VARCHAR(1024) NOT NULL
        );
CREATE INDEX JCR_IDX_MITEM_PATH ON JCR_MITEM(PATH);
 
Navigation

Creator: Administrator on 2007/05/22 15:51
Copyright (c) 2000-2009. Allright reserved - eXo platform SAS
1.6.13286