org.openanzo.common.rdb.layout
Class NodeLayoutBase<T extends org.openrdf.model.Value>

java.lang.Object
  extended by org.openanzo.common.rdb.layout.NodeLayoutBase<T>
Type Parameters:
T - Type of Value being stored
All Implemented Interfaces:
INodeLayout<T>
Direct Known Subclasses:
NodeLiteralLayout, NodeURILayout, NodeXMLLiteralLayout

public abstract class NodeLayoutBase<T extends org.openrdf.model.Value>
extends java.lang.Object
implements INodeLayout<T>

Abstract class. Provides read/write access to node's persisted in either a single table or two tables, where the first table stores nodes short enough to be indexed and the second table stores the long nodes. In the long node table hashes are generated for the indices.

Author:
Joe Betz, Stephen Evanchik

Constructor Summary
NodeLayoutBase(SQLCache sqlCache, Sequence sequence, java.lang.String sequenceName, java.lang.String longSequenceName, java.lang.String tableName, java.lang.String longTableName, java.lang.String resourceTempTableName, java.lang.String idTempTableName, int maxLength, java.lang.String optimizationString)
          Construct a layout to store nodes in a database
 
Method Summary
 java.lang.Long fetchId(T n)
          Fetches a node's ID from the database
 java.lang.String getLongSequenceName()
          Get the longSequenceName
 java.lang.String getSequenceName()
          Get the sequenceName
 boolean isLong(T n)
          Determines whether or not a node is 'long'
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openanzo.common.rdb.layout.INodeLayout
convert, fetchValue, getType, resolveStoredIds, resolveStoredNodes, store
 

Constructor Detail

NodeLayoutBase

public NodeLayoutBase(SQLCache sqlCache,
                      Sequence sequence,
                      java.lang.String sequenceName,
                      java.lang.String longSequenceName,
                      java.lang.String tableName,
                      java.lang.String longTableName,
                      java.lang.String resourceTempTableName,
                      java.lang.String idTempTableName,
                      int maxLength,
                      java.lang.String optimizationString)
Construct a layout to store nodes in a database

Parameters:
sqlCache - The interface to the SQL prepared statement cache
sequence - The sequence Object that is used to get IDs
sequenceName - The name of the sequence that is used to get IDs
longSequenceName - The name of the sequence that is used to get IDs for long objects
tableName - The name of the table where the nodes are stored
longTableName - The name of the table where excessively long nodes are stored
resourceTempTableName - The name of the temporary table used to bulk insert nodes
idTempTableName - The name of the temporary table used to bulk id resolution
maxLength - The maximum length of a node's string representation before it is considered long
optimizationString - Extra parameters added to queries for database specific optimizations
Method Detail

isLong

public boolean isLong(T n)
Determines whether or not a node is 'long'

Parameters:
n - The node to test
Returns:
true if the node is a long node, false otherwise

fetchId

public java.lang.Long fetchId(T n)
Description copied from interface: INodeLayout
Fetches a node's ID from the database

Specified by:
fetchId in interface INodeLayout<T extends org.openrdf.model.Value>
Parameters:
n - The node who's ID is to be found
Returns:
The ID of the node or null if not found

getLongSequenceName

public java.lang.String getLongSequenceName()
Get the longSequenceName

Returns:
the longSequenceName

getSequenceName

public java.lang.String getSequenceName()
Get the sequenceName

Returns:
the sequenceName


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.