jrunx.persistence.greylock
Class GetInstanceSqlBuilder

java.lang.Object
  |
  +--jrunx.persistence.greylock.BaseDB
        |
        +--jrunx.persistence.greylock.GetInstanceSqlBuilder
All Implemented Interfaces:
Const

public class GetInstanceSqlBuilder
extends BaseDB
implements Const

Class to aid in the construction of Sql statements for the retrieval of instances. There are three possibilities: 1. Instance with no embedded props 2. Instance with embedded props 3. Instance with Array of embedded props The third case requires some fancy footwork as the join will be different for this case. The join will depend on whether this is the first node in the graph. If so then the join will be on instances.name. As the graph is traversed if any arrays of embedded props are encountered it will then be necessary to join on the embedded property instance id.


Inner Class Summary
static class GetInstanceSqlBuilder.DBEmbeddedPropertyException
          Property, {property}, of Type, {typeName}, is not an embedded property
 class GetInstanceSqlBuilder.InvalidIDTypeException
          Invalid ID type: {typeName}
 
Fields inherited from interface jrunx.persistence.greylock.Const
ARRAYED, BIGINT, BIT, BLOB, BYTE, CHAR, DOUBLE, FLOAT, ID, ID_TABLE, INCREMENT, INDEX, INSTANCE, INSTANCE_FORGE_IDS, INSTANCE_ID, INSTANCE_TABLE, INTEGER, INTERNALID, NAME, PARENT, PROPERTY_ID, PROPERTY_TABLE, RELATION_ID, SEARCHABLE, SEQUENCE_PROCEDURE, SHORT, SINK, SOURCE, TIMESTAMP, TYPE_FORGE_IDS, TYPE_ID, TYPE_TABLE, UNDERSCORE, VARCHAR, VIEW
 
Constructor Summary
GetInstanceSqlBuilder(CFODBMetaData mdata)
           
 
Method Summary
protected  java.lang.String getEmbeddedInstSql(CFODBMetaData type, java.lang.String prop, java.lang.Object arg)
           
protected  java.lang.String getFindAllSql()
           
protected  java.lang.String getFindInstSql(java.lang.Long instanceID)
          For retrieval of embedded instances.
protected  java.lang.String getFindInstSql(java.lang.Object arg)
          For retrieval of instances where the arg type is not known.
protected  java.lang.String getFindInstSql(java.lang.String instanceName)
          For retrieval of scalar instances
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetInstanceSqlBuilder

public GetInstanceSqlBuilder(CFODBMetaData mdata)
                      throws java.lang.Exception
Method Detail

getFindAllSql

protected java.lang.String getFindAllSql()

getEmbeddedInstSql

protected java.lang.String getEmbeddedInstSql(CFODBMetaData type,
                                              java.lang.String prop,
                                              java.lang.Object arg)
                                       throws java.lang.Exception

getFindInstSql

protected java.lang.String getFindInstSql(java.lang.String instanceName)
For retrieval of scalar instances
Parameters:
instanceName - String
Returns:
 

getFindInstSql

protected java.lang.String getFindInstSql(java.lang.Long instanceID)
For retrieval of embedded instances.
Parameters:
instanceID - int
Returns:
 

getFindInstSql

protected java.lang.String getFindInstSql(java.lang.Object arg)
For retrieval of instances where the arg type is not known. Must be a Long or a String
Parameters:
instanceID - int
Returns:
 


Copyright � 2002 Macromedia Corporation. All Rights Reserved.