rjw.dc.db
Class Query

java.lang.Object
  |
  +--rjw.dc.db.Query

public class Query
extends java.lang.Object

Creates a query String by using the QueryOptions, the QueryWhat, the QueryConditions and the query type Later this class might start using other database languages as well

Since:
1.3
Version:
DC0.50
Author:
Robert-Jan van der Waals

Field Summary
static int _CREATE
          Create statement
static int _INSERT
          Insert query
static int _SELECT
          Select query
static int _UNDEFINED
          Undifined query
static int _UPDATE
          Update query
 
Constructor Summary
Query(QueryWhat what, QueryCondition conditions, QueryOptions options, int iQueryType, RequestorCollection requestors, java.lang.String sID)
          Creates a new Query object.
Query(QueryWhat what, QueryCondition conditions, QueryOptions options, int iQueryType, RequestorCollection requestors, java.lang.String sID, int iRowNumber)
          Creates a new Query object.
 
Method Summary
 java.lang.String getQueryString()
          Returns the query string.
 int getQueryType()
          Returns the query type
 java.lang.String getRecordID()
          Returns the unique record ID
 RequestorCollection getRequestors()
          Returns the requestors
 boolean getSilence()
          Specifies whether the query should report events to the log and the UI
 void setQueryString(java.lang.String sQuery)
          Sets the query string
 void setSilence(boolean silence)
          Sets the query to silent.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_UNDEFINED

public static final int _UNDEFINED
Undifined query

See Also:
Constant Field Values

_UPDATE

public static final int _UPDATE
Update query

See Also:
Constant Field Values

_CREATE

public static final int _CREATE
Create statement

See Also:
Constant Field Values

_INSERT

public static final int _INSERT
Insert query

See Also:
Constant Field Values

_SELECT

public static final int _SELECT
Select query

See Also:
Constant Field Values
Constructor Detail

Query

public Query(QueryWhat what,
             QueryCondition conditions,
             QueryOptions options,
             int iQueryType,
             RequestorCollection requestors,
             java.lang.String sID)
Creates a new Query object. In this object the condition values and their fields are stored, the columns of the object, the options, the query type and the requestors of the query (which might want the query to result in an action). Calls Query(what, conditions, options, iQueryType, requestors, sID, rowNumber)


Query

public Query(QueryWhat what,
             QueryCondition conditions,
             QueryOptions options,
             int iQueryType,
             RequestorCollection requestors,
             java.lang.String sID,
             int iRowNumber)
Creates a new Query object. In this object the condition values and their fields are stored, the columns of the object, the options, the query type and the requestors of the query (which might want the query to result in an action)

The public query types are not all there is to it, depending on the query options, a subtype is set (only in case of select queries)

From these values a query string is created

Parameters:
what - specifies the columns and tablename
conditions - the fields with their values which form the condition (can be null)
options - options for the query (can be null)
iQueryType - the query type (insert/update/..)
requestors - actions which are past on to the requestors (can be null)
sID - unique ID of the record
iRowNumber - rowNumber from table on screen
Method Detail

getRecordID

public java.lang.String getRecordID()
Returns the unique record ID

Returns:
(String) unique ID

setQueryString

public void setQueryString(java.lang.String sQuery)
Sets the query string

Parameters:
sQuery - query string

getQueryType

public int getQueryType()
Returns the query type

Returns:
(int) query type indentifier

getSilence

public boolean getSilence()
Specifies whether the query should report events to the log and the UI

Returns:
(boolean) specifies if the query is run silently

setSilence

public void setSilence(boolean silence)
Sets the query to silent. Silent means that no events are logged

Parameters:
silence - specifies if the query should run silently

getRequestors

public RequestorCollection getRequestors()
Returns the requestors

Returns:
(RequestorCollection) the requestor of the query which are waiting for an action

getQueryString

public java.lang.String getQueryString()
Returns the query string. The query string is created if it doesn't exist as yet return (String) query string