org.nsdl.mptstore.impl.h2
Class H2DDLGenerator

java.lang.Object
  extended by org.nsdl.mptstore.core.AbstractDDLGenerator
      extended by org.nsdl.mptstore.impl.h2.H2DDLGenerator
All Implemented Interfaces:
DDLGenerator

public class H2DDLGenerator
extends AbstractDDLGenerator

A DDLGenerator that works with H2.

The map table DDL defines pKey as a INT AUTO_INCREMENT value and p as an unbound VARCHAR value, with indexes on each column.

The relationship table DDL defines s and o as VARCHAR values, with indexes on each column.

In H2, there is no pre-defined limit on the length of a VARCHAR, unless one is provided. VARCHARs must, however, be able to fit entirely in memory. As a result, this DDLGenerator does not specify an artificial limit to their length.

Author:
birkland

Constructor Summary
H2DDLGenerator()
          Create an H2 DDLGenerator with no length limit textual values.
 
Method Summary
 java.util.List<java.lang.String> getCreateMapTableDDL(java.lang.String table)
          Get the DDL command(s) necessary to create a map table with the given name.
 java.util.List<java.lang.String> getCreateSOTableDDL(java.lang.String table)
          Get the DDL command(s) necessary to create a subject-object relationship table (aka predicate table) with the given name.
 
Methods inherited from class org.nsdl.mptstore.core.AbstractDDLGenerator
getDropMapTableDDL, getDropSOTableDDL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

H2DDLGenerator

public H2DDLGenerator()
Create an H2 DDLGenerator with no length limit textual values.

Method Detail

getCreateMapTableDDL

public java.util.List<java.lang.String> getCreateMapTableDDL(java.lang.String table)
Get the DDL command(s) necessary to create a map table with the given name.

Parameters:
table - The map table name.
Returns:
The necessary DDL.

getCreateSOTableDDL

public java.util.List<java.lang.String> getCreateSOTableDDL(java.lang.String table)
Get the DDL command(s) necessary to create a subject-object relationship table (aka predicate table) with the given name.

Parameters:
table - The relationship table name.
Returns:
The necessary DDL.