org.norther.tammi.root.db.query
Interface DBCriteria

All Known Implementing Classes:
DBCriteriaAdapter, HibernateCriteria, OJBCriteria, XMLQueryCriteria

public interface DBCriteria

An interface to classes representing database query criteria.

Author:
Ilkka Priha

Field Summary
static String CLASS_ATTRIBUTE
          The class attribute.
static int EQ
          The equals to condition.
static int GE
          The greater than or equals to condition.
static int GT
          The greater than condition.
static int IN
          The in condition.
static int LE
          The greater than or equals to condition.
static int LIKE
          The like condition.
static int LT
          The less than condition.
static int NEQ
          The not equals to condition.
static int NIN
          The not in condition.
static int NONE
          The none condition.
static String OBJECT_NAME_ATTRIBUTE
          The object name attribute.
 
Method Summary
 DBCriteria add(DBAttribute attribute, boolean union)
          Adds an attribute criteria.
 DBCriteria add(DBCriteria criteria, boolean union)
          Adds the specified criteria.
 DBCriteria add(List attributes, boolean union)
          Adds an attribute list criteria.
 DBCriteria add(Map attributes, int condition, boolean union)
          Adds an attribute map criteria.
 DBCriteria add(String attribute, Object value, int condition, boolean union)
          Adds a named attribute value criteria.
 Object getAdaptee()
          Gets the implementation specific criteria adaptee, if any.
 DBCriteria negate()
          Negates the criteria.
 

Field Detail

CLASS_ATTRIBUTE

static final String CLASS_ATTRIBUTE
The class attribute.

See Also:
Constant Field Values

OBJECT_NAME_ATTRIBUTE

static final String OBJECT_NAME_ATTRIBUTE
The object name attribute.

See Also:
Constant Field Values

NONE

static final int NONE
The none condition.

See Also:
Constant Field Values

LIKE

static final int LIKE
The like condition.

See Also:
Constant Field Values

EQ

static final int EQ
The equals to condition.

See Also:
Constant Field Values

NEQ

static final int NEQ
The not equals to condition.

See Also:
Constant Field Values

IN

static final int IN
The in condition.

See Also:
Constant Field Values

NIN

static final int NIN
The not in condition.

See Also:
Constant Field Values

GT

static final int GT
The greater than condition.

See Also:
Constant Field Values

LT

static final int LT
The less than condition.

See Also:
Constant Field Values

GE

static final int GE
The greater than or equals to condition.

See Also:
Constant Field Values

LE

static final int LE
The greater than or equals to condition.

See Also:
Constant Field Values
Method Detail

getAdaptee

Object getAdaptee()
Gets the implementation specific criteria adaptee, if any.

Returns:
the adaptee or null.

negate

DBCriteria negate()
Negates the criteria.

Returns:
the modified criteria.

add

DBCriteria add(DBCriteria criteria,
               boolean union)
Adds the specified criteria.

Parameters:
criteria - the new criteria.
union - the flag for a union.
Returns:
the modified criteria.

add

DBCriteria add(DBAttribute attribute,
               boolean union)
Adds an attribute criteria.

If exact match is not required, the value can be a pattern with well known wildcard characters such as '*', '?', or in the case of SQL '%'.

Parameters:
attribute - the attribute to form the search criteria.
union - the flag for a union.
Returns:
the modified criteria.

add

DBCriteria add(List attributes,
               boolean union)
Adds an attribute list criteria.

If exact match is not required, the value can be a pattern with well known wildcard characters such as '*', '?', or in the case of SQL '%'.

Parameters:
attributes - a list of attributes to form the search criteria.
union - a flag to indicate whether the criteria should be a union.
Returns:
the modified criteria.

add

DBCriteria add(String attribute,
               Object value,
               int condition,
               boolean union)
Adds a named attribute value criteria.

If exact match is not required, the value can be a pattern with well known wildcard characters such as '*', '?', or in the case of SQL '%'.

Parameters:
attribute - the field name to form the search criteria.
value - the field value to form the search criteria.
condition - the condition for the attribute.
union - the flag for a union.
Returns:
the modified criteria.

add

DBCriteria add(Map attributes,
               int condition,
               boolean union)
Adds an attribute map criteria.

If exact match is not required, the value can be a pattern with well known wildcard characters such as '*', '?', or in the case of SQL '%'.

Parameters:
attributes - a map of attributes to form the search criteria.
condition - the condition for the criteria.
union - the flag for a union.
Returns:
the modified criteria.


Copyright © 2004 The Norther Organization. All rights reserved.