org.rimudb
Class WhereList

java.lang.Object
  extended by org.rimudb.WhereList
All Implemented Interfaces:
java.io.Serializable

public class WhereList
extends java.lang.Object
implements java.io.Serializable

This class represents a list of properties which can be used to select the results returned from a Table.

Author:
Simon Ritchie
See Also:
Serialized Form

Constructor Summary
WhereList()
          Constructor
WhereList(KeyList keyList)
           
 
Method Summary
 WhereList add_AND_EQ(java.lang.String propertyName, java.lang.Object value)
          A convenience method to add an entry by property name and a value.
 WhereList add(BooleanOperator booleanOperator, java.lang.String propertyName, Operator operator, java.lang.Object value)
          Add an entry by BooleanOperator, property name, operation and a value.
 WhereList add(BooleanOperator booleanOperator, java.lang.String propertyName, Operator operator, java.lang.Object value, boolean valueIsProperty)
          Add an entry by BooleanOperator, property name, comparison operator, value and valueIsProperty.
 WhereList add(java.lang.String propertyName, Operator operator, java.lang.Object value)
          Add an entry by property name, operation and a value.
 WhereList add(java.lang.String propertyName, Operator operator, java.lang.Object value, boolean valueIsProperty)
          Add an entry by property name, operation and a value.
 boolean equals(java.lang.Object obj)
           
 boolean equalsPartial(java.lang.Object obj)
          Return true if the partial whereList contains identical keys to the partial part of this whereList.
 BooleanOperator getBooleanOperator(int index)
          Return the BooleanOperator for the index
 Operator getOperator(int index)
          Return the Operator for the index
 java.lang.String getPropertyName(int index)
          Return the property name for the index
 java.lang.String getUniquePropertyID()
          Return a unique ID.
 java.lang.Object getValue(int index)
          Return the value for the index
 java.util.List<WhereEntry> getWhereEntryList()
           
 boolean hasEntries()
          Return true if the WhereList has entries.
 int hashCode()
           
 boolean isValueProperty(int index)
          Return true if the value is a property.
 int size()
           
 java.lang.String toString()
          Return a string representing the WhereList.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WhereList

public WhereList()
Constructor


WhereList

public WhereList(KeyList keyList)
Parameters:
keyList -
Method Detail

add

public WhereList add(java.lang.String propertyName,
                     Operator operator,
                     java.lang.Object value)
Add an entry by property name, operation and a value. The property name should be a static variable from the DO class i.e. OrderTransactionDO.F_LAST_NAME.


add_AND_EQ

public WhereList add_AND_EQ(java.lang.String propertyName,
                            java.lang.Object value)
A convenience method to add an entry by property name and a value. The AND boolean operator and the EQ comparison operator are used. The property name should be a static variable from the DO class i.e. OrderTransactionDO.F_LAST_NAME.


add

public WhereList add(BooleanOperator booleanOperator,
                     java.lang.String propertyName,
                     Operator operator,
                     java.lang.Object value)
Add an entry by BooleanOperator, property name, operation and a value. The property name should be a static variable from the DO class i.e. OrderTransactionDO.F_LAST_NAME.


add

public WhereList add(java.lang.String propertyName,
                     Operator operator,
                     java.lang.Object value,
                     boolean valueIsProperty)
Add an entry by property name, operation and a value. The property name should be a static variable from the DO class i.e. OrderTransactionDO.F_LAST_NAME.


add

public WhereList add(BooleanOperator booleanOperator,
                     java.lang.String propertyName,
                     Operator operator,
                     java.lang.Object value,
                     boolean valueIsProperty)
Add an entry by BooleanOperator, property name, comparison operator, value and valueIsProperty. The property name should be a static variable from the DO class i.e. OrderTransactionDO.F_LAST_NAME.


getUniquePropertyID

public java.lang.String getUniquePropertyID()
Return a unique ID. This ID is intended to be used for caching SQL statements. The property names and operators are part of the uniqueID, but the values are not.


getWhereEntryList

public java.util.List<WhereEntry> getWhereEntryList()

hasEntries

public boolean hasEntries()
Return true if the WhereList has entries.

Returns:
boolean Returns true if there are entries in the WhereList

size

public int size()

getPropertyName

public java.lang.String getPropertyName(int index)
Return the property name for the index

Parameters:
index - int
Returns:
String Returns the property name at index

isValueProperty

public boolean isValueProperty(int index)
Return true if the value is a property.

Parameters:
index - int
Returns:
boolean Returns true if the value is a property

getBooleanOperator

public BooleanOperator getBooleanOperator(int index)
Return the BooleanOperator for the index

Parameters:
index - int
Returns:
Operator Returns the BooleanOperator at the index

getOperator

public Operator getOperator(int index)
Return the Operator for the index

Parameters:
index - int
Returns:
Operator Returns the Operator at the index

getValue

public java.lang.Object getValue(int index)
Return the value for the index

Parameters:
index - int
Returns:
Object Returns the value at index

toString

public java.lang.String toString()
Return a string representing the WhereList.

Overrides:
toString in class java.lang.Object
Returns:
String

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

equalsPartial

public boolean equalsPartial(java.lang.Object obj)
Return true if the partial whereList contains identical keys to the partial part of this whereList. The whereList are compared to find the whereList with the smallest number of keys. This number of keys are compared between each whereList. This allows the whereList of a child record to be compared with the whereList of parent to see if the primary keys match.

Parameters:
obj - Object
Returns:
boolean


Copyright © 2008-2011 Simon Ritchie. All Rights Reserved.