org.nsdl.mptstore.impl.postgres
Class PostgresDDLGenerator

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

public class PostgresDDLGenerator
extends AbstractDDLGenerator

A DDLGenerator that works with Postgres.

The map table DDL defines pKey as a SERIAL value and p as a TEXT value, with indexes on each column.

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

Since Postgres automatically drops associated indexes and sequences when the table is dropped, the AbstractDDLGenerator implementation is used for the drop methods.

Author:
cwilper@cs.cornell.edu

Constructor Summary
PostgresDDLGenerator()
          Construct a PostgresDDLGenerator.
 
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

PostgresDDLGenerator

public PostgresDDLGenerator()
Construct a PostgresDDLGenerator.

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.