com.objectwave.persist.constraints
Class ConstraintSubSelect

java.lang.Object
  |
  +--com.objectwave.persist.constraints.Constraint
        |
        +--com.objectwave.persist.constraints.ConstraintSubSelect
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class ConstraintSubSelect
extends Constraint

Define & manage the "any of" and "not any of" constraints.

Version:
1.1
Author:
Steven Sinclair
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.objectwave.persist.constraints.Constraint
columnName, defaultObjectFormatter, objectFormatter
 
Constructor Summary
ConstraintSubSelect()
           
 
Method Summary
 boolean checkConstraint(java.lang.Object dataField, java.lang.Object queryField)
          Check if the dataField is in the list of previously defined fields.
 java.lang.String constructQueryString()
          Create as string representing an anOf constraint.
 void fromString(java.lang.String str)
          Parse the string.
static java.util.Vector getFields()
           
protected  java.lang.String getQueryStatement()
           
 java.util.Enumeration getStaticList()
          Gets the StaticList attribute of the Constraint object
 java.lang.String getSubSelectField()
           
 SQLQuery getSubSelectQuery()
           
 java.lang.String getType()
          This is a unique, readable string identifying the constraint type (ex, anyof, null)
 void setSubSelectField(java.lang.String subSelectField)
           
 void setSubSelectQuery(SQLQuery subSelectQuery)
           
 void staticListInsert(java.lang.String field)
          Each type of constraint will have a specific set of fields associated with it.
 java.lang.String stringify()
          Stringify the object.
 
Methods inherited from class com.objectwave.persist.constraints.Constraint
checkConstraint, classOfField, clone, equals, findField, formatString, getColumnName, getField, getNot, getObjectFormatter, getPersistence, isComparisonValueFromPersistentObject, isUsingColumnName, setColumnName, setField, setNot, setObjectFormatter, setPersistence, sqlString, stringToObject, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstraintSubSelect

public ConstraintSubSelect()
Method Detail

checkConstraint

public boolean checkConstraint(java.lang.Object dataField,
                               java.lang.Object queryField)
Check if the dataField is in the list of previously defined fields.

Specified by:
checkConstraint in class Constraint
Parameters:
dataField - The data from an object in the 'pool'.
queryField - The data from the Query object. Not used in an anyOf comparison.
Returns:
boolean The result of the constraint comparison

constructQueryString

public java.lang.String constructQueryString()
Create as string representing an anOf constraint.

Specified by:
constructQueryString in class Constraint
Returns:
String The in or not in portion of a where clause.

getQueryStatement

protected java.lang.String getQueryStatement()
Returns:
true if we are to send the buffer on, false if there were no values.

fromString

public void fromString(java.lang.String str)
                throws java.text.ParseException
Description copied from class: Constraint
Parse the string. Probably a string encoded via the toString() call, this method attempts to build the object's state from the information in string "str".

Specified by:
fromString in class Constraint
Parameters:
str -
Throws:
java.text.ParseException

getFields

public static java.util.Vector getFields()

getStaticList

public java.util.Enumeration getStaticList()
Description copied from class: Constraint
Gets the StaticList attribute of the Constraint object

Specified by:
getStaticList in class Constraint
Returns:
The StaticList value

getType

public java.lang.String getType()
Description copied from class: Constraint
This is a unique, readable string identifying the constraint type (ex, anyof, null)

Specified by:
getType in class Constraint
Returns:
The Type value

getSubSelectQuery

public SQLQuery getSubSelectQuery()

getSubSelectField

public java.lang.String getSubSelectField()

setSubSelectQuery

public void setSubSelectQuery(SQLQuery subSelectQuery)

setSubSelectField

public void setSubSelectField(java.lang.String subSelectField)

staticListInsert

public void staticListInsert(java.lang.String field)
Description copied from class: Constraint
Each type of constraint will have a specific set of fields associated with it. This is to allow the user to select them via Gui.

Specified by:
staticListInsert in class Constraint
Parameters:
field -

stringify

public java.lang.String stringify()
Description copied from class: Constraint
Stringify the object. Object serialization may be a better approach. Oh well. Encode the class's type and state in a readable string.

Specified by:
stringify in class Constraint
Returns:
a readable string revealing the contents