org.nsdl.mptstore.impl.derby
Class DerbyDDLGenerator

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

public class DerbyDDLGenerator
extends AbstractDDLGenerator

A DDLGenerator that works with Derby.

The map table DDL defines pKey as INT NOT NULL GENERATED ALWAYS AS IDENTITY, and p as a VARCHAR, with indexes on each column.

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

The default VARCHAR length is 512, but this can be overridden by using the appropriate constructor. Note: Derby's limit for VARCHAR length is actually 32,672 characters, but because these values are indexed, the actual maximum possible here is lower and dependent on the page size that Derby has been configured to use. See the Derby Reference Manual for more information.

Author:
cwilper@cs.cornell.edu
See Also:
Derby Reference Manual

Constructor Summary
DerbyDDLGenerator()
          Construct a DerbyDDLGenerator that uses the default maximum length (512) for varchar columns that store URIs and literals.
DerbyDDLGenerator(int varcharLength)
          Construct a DerbyDDLGenerator that uses the specified maximum length for varchar columns that store URIs and literals.
 
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

DerbyDDLGenerator

public DerbyDDLGenerator()
Construct a DerbyDDLGenerator that uses the default maximum length (512) for varchar columns that store URIs and literals.


DerbyDDLGenerator

public DerbyDDLGenerator(int varcharLength)
Construct a DerbyDDLGenerator that uses the specified maximum length for varchar columns that store URIs and literals.

Parameters:
varcharLength - the length for all VARCHAR columns.
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.