org.apache.ojb.broker.query
Class SelectionCriteria

java.lang.Object
  extended by org.apache.ojb.broker.query.SelectionCriteria
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ExistsCriteria, FieldCriteria, SqlCriteria, ValueCriteria

public abstract class SelectionCriteria
extends java.lang.Object
implements java.io.Serializable

abstract baseclass of all criteria classes, can't be instantiated. This code is based on stuff from COBRA - Java Object Persistence Layer Copyright (C) 1997, 1998 DB Harvey-George eMail: cobra@lowrent.org

Version:
$Id: SelectionCriteria.java 365232 2005-12-21 22:36:07Z tomdz $
Author:
DB Harvey-George, Thomas Mahler, Jakob Braeuchi
See Also:
Serialized Form

Method Summary
 void bind(java.lang.Object newValue)
          sets the value of the criteria to newValue.
 java.lang.String getAlias()
           
 java.lang.Object getAttribute()
          Answer the attribute
 java.util.List getClassesForPath(java.lang.String aPath)
          Get the a List of Class objects used as hints for a path
abstract  java.lang.String getClause()
          Answer the SQL compare-clause for this criteria
 Criteria getCriteria()
           
 int getNumberOfExtentsToBind()
          Returns the numberOfExtentsToBind.
 java.util.Map getPathClasses()
          Gets the pathClasses from the parent Criteria.
 QueryByCriteria getQuery()
           
 UserAlias getUserAlias()
           
 java.lang.Object getValue()
          Answer the value
 boolean isBound()
          BRJ : Used by the ODMG OQLQuery.bind() operation
 boolean isTranslateAttribute()
           
 void setAlias(java.lang.String alias)
          Sets the alias.
 void setAlias(java.lang.String alias, java.lang.String aliasPath)
          Sets the alias.
 void setAlias(UserAlias userAlias)
          Sets the alias using a userAlias object.
 void setNumberOfExtentsToBind(int numberOfExtentsToBind)
          Sets the numberOfExtentsToBind.
 java.lang.String toString()
          String representation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getClause

public abstract java.lang.String getClause()
Answer the SQL compare-clause for this criteria


bind

public void bind(java.lang.Object newValue)
sets the value of the criteria to newValue. Used by the ODMG OQLQuery.bind() operation


getValue

public java.lang.Object getValue()
Answer the value


getAttribute

public java.lang.Object getAttribute()
Answer the attribute


toString

public java.lang.String toString()
String representation

Overrides:
toString in class java.lang.Object

isBound

public boolean isBound()
BRJ : Used by the ODMG OQLQuery.bind() operation

Returns:
Returns a boolean indicator

getNumberOfExtentsToBind

public int getNumberOfExtentsToBind()
Returns the numberOfExtentsToBind.

Returns:
int

setNumberOfExtentsToBind

public void setNumberOfExtentsToBind(int numberOfExtentsToBind)
Sets the numberOfExtentsToBind.

Parameters:
numberOfExtentsToBind - The numberOfExtentsToBind to set

getAlias

public java.lang.String getAlias()
Returns:
String

setAlias

public void setAlias(java.lang.String alias)
Sets the alias. By default the entire attribute path participates in the alias

Parameters:
alias - The name of the alias to set

setAlias

public void setAlias(java.lang.String alias,
                     java.lang.String aliasPath)
Sets the alias.

Parameters:
alias - The alias to set

setAlias

public void setAlias(UserAlias userAlias)
Sets the alias using a userAlias object.

Parameters:
userAlias - The alias to set

getUserAlias

public UserAlias getUserAlias()

isTranslateAttribute

public boolean isTranslateAttribute()
Returns:
true if attribute name should be translated into column name

getCriteria

public Criteria getCriteria()
Returns:

getQuery

public QueryByCriteria getQuery()

getPathClasses

public java.util.Map getPathClasses()
Gets the pathClasses from the parent Criteria. A Map containing hints about what Class to be used for what path segment

Returns:
Returns a Map

getClassesForPath

public java.util.List getClassesForPath(java.lang.String aPath)
Get the a List of Class objects used as hints for a path

Parameters:
aPath - the path segment ie: allArticlesInGroup
Returns:
a List o Class objects to be used in SqlStatment
See Also:
org.apache.ojb.broker.QueryTest#testInversePathExpression()


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30