org.qriterium.dogma
Class SQLHandler

java.lang.Object
  extended by org.qriterium.dogma.SQLHandler

public class SQLHandler
extends java.lang.Object


Constructor Summary
SQLHandler()
           
 
Method Summary
static java.lang.String collectionQuery(DogmaResource resource)
          collectionQuery is not currently in use.
static java.lang.String connectionQuery(DogmaResource resource)
          connectionQuery searches all connections associated with resource given as a parameter.
static java.lang.String connectionToExec(DogmaConnection connection, java.lang.String oper)
          Parses a connection to a new reference row into the database or updates an existing one.
static java.lang.String connectionToQuery(DogmaConnection connection)
          connectionToQuery searches for a specific connection between two resources.
static java.lang.String containsReference(java.lang.String key)
          searches for a reference by key.
static java.lang.String dataToQuery(ResourceFactory rf)
           
static java.lang.String getTagQuery(java.lang.String tag)
          getTagQuery searches all resources associated with a given tag.
static java.lang.String resourceSearch(DogmaResource resource)
           
static java.lang.String resourceToExec(DogmaResource resource, java.lang.String oper)
          Parses resource to a SQL-query.
static java.lang.String resourceToQuery(DogmaResource resource)
          resourceToQuery parses an SQL query from a given Dogmaresource.
static java.lang.String searchByTag(java.lang.String tag)
          searches all resources associated to a tag.
static java.lang.String uriToExec(DogmaURI uri, java.lang.String oper)
          Adds an URI or updates a current one.
static java.lang.String uriToQuery(DogmaResource resource)
          constructs a query to search any URI associated with given resource.
static java.lang.String uriToQuery(DogmaURI uri)
          Creates a SQL-query from the given URI.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLHandler

public SQLHandler()
Method Detail

resourceToQuery

public static java.lang.String resourceToQuery(DogmaResource resource)
resourceToQuery parses an SQL query from a given Dogmaresource. Currently only searches by canoname are supported. ResourceToQuery searches for an exact match. For partial match-searches, use resourceSearch

Parameters:
resource -
Returns:
the SQL query string.

resourceSearch

public static java.lang.String resourceSearch(DogmaResource resource)

collectionQuery

public static java.lang.String collectionQuery(DogmaResource resource)
collectionQuery is not currently in use.

Parameters:
resource -
Returns:

getTagQuery

public static java.lang.String getTagQuery(java.lang.String tag)
getTagQuery searches all resources associated with a given tag.

Parameters:
tag -
Returns:
SQL query string

connectionQuery

public static java.lang.String connectionQuery(DogmaResource resource)
connectionQuery searches all connections associated with resource given as a parameter.

Parameters:
resource -
Returns:
SQL query string.

connectionToQuery

public static java.lang.String connectionToQuery(DogmaConnection connection)
connectionToQuery searches for a specific connection between two resources.

Parameters:
connection -
Returns:

containsReference

public static java.lang.String containsReference(java.lang.String key)
searches for a reference by key.

Parameters:
key -
Returns:

searchByTag

public static java.lang.String searchByTag(java.lang.String tag)
searches all resources associated to a tag.

Parameters:
tag -
Returns:

uriToQuery

public static java.lang.String uriToQuery(DogmaURI uri)
Creates a SQL-query from the given URI.

Parameters:
uri -
Returns:

uriToQuery

public static java.lang.String uriToQuery(DogmaResource resource)
constructs a query to search any URI associated with given resource.

Parameters:
resource -
Returns:

dataToQuery

public static java.lang.String dataToQuery(ResourceFactory rf)

resourceToExec

public static java.lang.String resourceToExec(DogmaResource resource,
                                              java.lang.String oper)
Parses resource to a SQL-query. If the querytype is UPDATE, the canoname of the resource is used as an identifier for the update.

Parameters:
resource - The resource to be parsed turned into a sql-query.
oper - The type of the operation we want. Possibilities: INSERT, UPDATE and DELETE (delete not implemented).
Returns:
Returns a SQL-query string based on the parameters.

connectionToExec

public static java.lang.String connectionToExec(DogmaConnection connection,
                                                java.lang.String oper)
Parses a connection to a new reference row into the database or updates an existing one. The delete function is not currently in use.

Parameters:
connection -
oper -
Returns:

uriToExec

public static java.lang.String uriToExec(DogmaURI uri,
                                         java.lang.String oper)
Adds an URI or updates a current one. The delete option is currently not in use.

Parameters:
uri -
oper -
Returns: