org.openanzo.jdbc.utils.opgen
Class RdbStatement

java.lang.Object
  extended by org.openanzo.jdbc.utils.opgen.RdbStatement

public class RdbStatement
extends java.lang.Object

Provides XML deserialization and accessors for rdf statements (SQL, DDL, etc.) for use in composing SQLCache compatable .sql files and generating java rdf statement wrappers.

Author:
Joe Betz

Nested Class Summary
static class RdbStatement.Parameter
          Class the contains an input/output/template parameter
 
Constructor Summary
RdbStatement(java.lang.String sqlPackageName, org.w3c.dom.Element xmlElement)
          Create a new RdbStatement from the given XML emement data
RdbStatement(java.lang.String sqlPackageName, java.lang.String name, java.lang.String sql, java.util.List<RdbStatement.Parameter> inputs, java.util.List<RdbStatement.Parameter> outputs, java.util.List<RdbStatement.Parameter> templateParams, Result results)
          Create a new RdbStatement
 
Method Summary
 java.lang.String capitalizedName()
          Capitalize the name of the statement
static java.lang.String getBoxReturnType(java.lang.String val)
          Return the boxed return type
 java.lang.String getInputParamImpl()
          Get the Implementation name for this statement's parameters
 java.lang.String getInputParamInterface()
          Get the Interface name for this statement's parameters
 java.lang.String getInputParams()
          Get the string representing for the input parameters to this statement
 java.lang.String getInputParamSigniture()
          Get the full string representing for the input parameters to this statement
 java.lang.String getInputParamsJavadoc()
          Get the javadoc representing for the input parameters to this statement
 java.util.List<RdbStatement.Parameter> getInputs()
          Get the input parameters for this statement
 java.lang.String getJavaType()
          Get the javatype for this statement
 java.lang.String getJdbcType()
          Get the jdbc type for this statement
 java.lang.String getName()
          Get the name of the statement
 java.util.List<RdbStatement.Parameter> getOutputs()
          Get the output parameters for this statement
 java.util.List<RdbStatement.Parameter> getParams()
          Get the template parameters for this statement
 java.lang.String getQualifiedName()
          Get the qualified name of the statement
 Result getResults()
          Get the result object for the statement
 java.lang.String getResultsImpl()
          Get the implementation name for this statement's results
 java.lang.String getResultsInterface()
          Get the interface name for this statement's results
 java.lang.String getReturnType()
          Get the return type for this statement
 java.lang.String getSql()
          Get the SQL query text for this statement
 java.lang.String getTemplateParams()
          Get the string representing for the template parameters to this statement
 java.lang.String getTemplateParamSigniture()
          Get the full string representing for the template parameters to this statement
 java.lang.String getTemplateParamsJavadoc()
          Get the javadoc representing for the template parameters to this statement
 java.lang.String getValueReturnType()
          Get the return type for this statement
 boolean hasInputParams()
          Return true if this statement has input parameters
 boolean hasInputParamType()
          Determine if this statement has input parameters
 boolean hasReturn()
          Return true if this statement expects results
 boolean hasTemplateParams()
          Return true if this statement has template parameters
static boolean isPrimitive(java.lang.String string)
          Return if the provided string is a primitive value type
static boolean isPrimitiveType(java.lang.String val)
          Return true if value is a primitive type
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RdbStatement

public RdbStatement(java.lang.String sqlPackageName,
                    java.lang.String name,
                    java.lang.String sql,
                    java.util.List<RdbStatement.Parameter> inputs,
                    java.util.List<RdbStatement.Parameter> outputs,
                    java.util.List<RdbStatement.Parameter> templateParams,
                    Result results)
Create a new RdbStatement

Parameters:
sqlPackageName - name of package
name - name of prepared statement
sql - SQL query text
inputs - inputs to the query
outputs - outputs expected from the query
templateParams - set of template parameters for the query
results - results type for query

RdbStatement

public RdbStatement(java.lang.String sqlPackageName,
                    org.w3c.dom.Element xmlElement)
Create a new RdbStatement from the given XML emement data

Parameters:
sqlPackageName - package name for statement
xmlElement - XML element containing data
Method Detail

getName

public java.lang.String getName()
Get the name of the statement

Returns:
the name of the statement

getQualifiedName

public java.lang.String getQualifiedName()
Get the qualified name of the statement

Returns:
the qualified name of the statement

capitalizedName

public java.lang.String capitalizedName()
Capitalize the name of the statement

Returns:
capitalized name of the statement

isPrimitive

public static boolean isPrimitive(java.lang.String string)
Return if the provided string is a primitive value type

Parameters:
string - type of value for which to determine primitive nature
Returns:
if the provided string is a primitive value type

getSql

public java.lang.String getSql()
Get the SQL query text for this statement

Returns:
the SQL query text for this statement

getInputs

public java.util.List<RdbStatement.Parameter> getInputs()
Get the input parameters for this statement

Returns:
the input parameters for this statement

getOutputs

public java.util.List<RdbStatement.Parameter> getOutputs()
Get the output parameters for this statement

Returns:
the output parameters for this statement

getParams

public java.util.List<RdbStatement.Parameter> getParams()
Get the template parameters for this statement

Returns:
the template parameters for this statement

getReturnType

public java.lang.String getReturnType()
Get the return type for this statement

Returns:
the return type for this statement

hasInputParamType

public boolean hasInputParamType()
Determine if this statement has input parameters

Returns:
if this statement has input parameters

getInputParamInterface

public java.lang.String getInputParamInterface()
Get the Interface name for this statement's parameters

Returns:
the Interface name for this statements parameters

getInputParamImpl

public java.lang.String getInputParamImpl()
Get the Implementation name for this statement's parameters

Returns:
the Implementation name for this statement's parameters

getResultsInterface

public java.lang.String getResultsInterface()
Get the interface name for this statement's results

Returns:
the interface name for this statement's results

getResultsImpl

public java.lang.String getResultsImpl()
Get the implementation name for this statement's results

Returns:
the implementation name for this statement's results

getInputParamSigniture

public java.lang.String getInputParamSigniture()
Get the full string representing for the input parameters to this statement

Returns:
the full string representing for the input parameters to this statement

getInputParams

public java.lang.String getInputParams()
Get the string representing for the input parameters to this statement

Returns:
the string representing for the input parameters to this statement

hasTemplateParams

public boolean hasTemplateParams()
Return true if this statement has template parameters

Returns:
true if this statement has template parameters

getTemplateParamSigniture

public java.lang.String getTemplateParamSigniture()
Get the full string representing for the template parameters to this statement

Returns:
the full string representing for the template parameters to this statement

getTemplateParams

public java.lang.String getTemplateParams()
Get the string representing for the template parameters to this statement

Returns:
the string representing for the template parameters to this statement

getTemplateParamsJavadoc

public java.lang.String getTemplateParamsJavadoc()
Get the javadoc representing for the template parameters to this statement

Returns:
the javadoc representing for the template parameters to this statement

getInputParamsJavadoc

public java.lang.String getInputParamsJavadoc()
Get the javadoc representing for the input parameters to this statement

Returns:
the javadoc representing for the input parameters to this statement

hasInputParams

public boolean hasInputParams()
Return true if this statement has input parameters

Returns:
true if this statement has input parameters

hasReturn

public boolean hasReturn()
Return true if this statement expects results

Returns:
true if this statement expects results

isPrimitiveType

public static boolean isPrimitiveType(java.lang.String val)
Return true if value is a primitive type

Parameters:
val - value for which to determine primitive status
Returns:
true if value is a primitive type

getBoxReturnType

public static java.lang.String getBoxReturnType(java.lang.String val)
Return the boxed return type

Parameters:
val - value to box
Returns:
the boxed return type

getValueReturnType

public java.lang.String getValueReturnType()
Get the return type for this statement

Returns:
the return type for this statement

getJavaType

public java.lang.String getJavaType()
Get the javatype for this statement

Returns:
the javatype for this statement

getJdbcType

public java.lang.String getJdbcType()
Get the jdbc type for this statement

Returns:
the jdbc type for this statement

getResults

public Result getResults()
Get the result object for the statement

Returns:
the result object for the statement


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