com.xerox.bantam
Interface QueryFactory

All Known Implementing Classes:
AbstractQueryFactory

public interface QueryFactory

Interface for constructing Query objects; the methods enumerate all permitted query predicate types.

The intended semantics is that each node has grouping parentheses around its arguments. That is, the code QueryFactory.and(or(A, B), C) constructs the query predicate ((A or B) and C).

Version:
$Revision: 1.11 $, $Date: 2000/12/05 23:08:03 $
Author:
Keith Edwards

Method Summary
 Query all()
          Matches all documents.
 Query and(Query left, Query right)
          Boolean conjunction of two sub-queries: matches documents matched by both the right and left sub-queries.
 Query conformsTo(Schema schema)
          Matches documents that conform to the named schema, that is, documents whose set of property values meets the requirements of the schema.
 Query create(String query)
          Placeholder for queries expressed as a String in an external query language.
 Query isEnforced(Schema schema)
          Matches documents that have the named schema enforced by the Storage implementation.
 Query not(Query query)
          Boolean negation of a sub-query: matches documents not matched by the sub-query.
 Query or(Query left, Query right)
          Boolean disjunction of two sub-queries: matches documents matched by either the right or the left sub-query or both.
 Query propertyContains(FieldDescriptor name, Object value)
           
 Query propertyContains(String name, Object value)
          Matches documents having the specified value equal to at least one value of the named property according to the semantics of Object.equals, with the following extensions: This predicate will match documents having more than one value for the named property.
 Query propertyContainsText(FieldDescriptor name, String substr)
           
 Query propertyContainsText(String name, String substr)
          Matches documents having the supplied value as a substring of the String value of the named property.
 Query propertyContainsTextIgnoreCase(FieldDescriptor name, String substr)
           
 Query propertyContainsTextIgnoreCase(String name, String substr)
          Matches documents having the supplied value as a substring of the String value of the named property, ignoring case.
 Query propertyEquals(FieldDescriptor name, Object value)
           
 Query propertyEquals(FieldDescriptor name, String value)
          Deprecated. Use propertyEquals(FieldDescriptor, Object) instead.
 Query propertyEquals(String name, Object value)
          Matches documents having the value of the named property equal to the specified value according to the semantics of Object.equals, with the following extensions: This predicate does not match documents having more than one value for the named property.
 Query propertyEquals(String name, String value)
          Deprecated. Use propertyEquals(String, Object) instead.
 Query propertyEqualsIgnoreCase(FieldDescriptor name, String value)
           
 Query propertyEqualsIgnoreCase(String name, String value)
          Matches documents having the String value of the named property equal to the specified value without regard to case, that is, using the semantics of String.equalsIgnoreCase, with the following extensions: This predicate does not match documents having more than one value for the named property.
 Query propertyExists(FieldDescriptor name)
          Matches documents having a value for the specified property name.
 Query propertyExists(String name)
          Matches documents having a value for the specified property name.
 Query propertyGreaterThan(FieldDescriptor name, Comparable value)
           
 Query propertyGreaterThan(String name, Comparable value)
          Matches documents having the value of the named property which is greater than the specified value according to the semantics of Java Comparable.compareTo, with the following extensions: This predicate does not match documents having more than one value for the named property.
 Query propertyGreaterThanEquals(FieldDescriptor name, Comparable value)
           
 Query propertyGreaterThanEquals(String name, Comparable value)
          Matches documents having the value of the named property which is greater than or equal to the specified value according to the semantics of Java Comparable.compareTo(), with the following extensions: This predicate does not match documents having more than one value for the named property.
 Query propertyLessThan(FieldDescriptor name, Comparable value)
           
 Query propertyLessThan(String name, Comparable value)
          Matches documents having the value of the named property which is less than the specified value according to the semantics of Comparable.compareTo, with the following extensions: This predicate does not match documents having more than one value for the named property.
 Query propertyLessThanEquals(FieldDescriptor name, Comparable value)
           
 Query propertyLessThanEquals(String name, Comparable value)
          Matches documents having the value of the named property which is less than or equal to the specified value according to the semantics of Comparable.compareTo, with the following extensions: This predicate does not match documents having more than one value for the named property.
 Query propertyNotEquals(FieldDescriptor name, Object value)
           
 Query propertyNotEquals(FieldDescriptor name, String value)
          Deprecated. Use propertyNotEquals(FieldDescriptor, Object) instead.
 Query propertyNotEquals(String name, Object value)
          Matches documents having the value of the named property which is not equal to the specified value according to the semantics of Object.equals, with the following extensions: This predicate does not match documents having more than one value for the named property.
 Query propertyNotEquals(String name, String value)
          Deprecated. Use propertyNotEquals(String, Object) instead.
 Query textContains(String value)
          Matches documents having the specified value as a substring of a text extraction of the content.
 

Method Detail

create

public Query create(String query)
             throws StorageException
Placeholder for queries expressed as a String in an external query language. There is no Bantam standard query language yet and this method will throw a runtime exception on most implementations. Do not rely upon this method or the format of any query expression that happens to work on a particular implementation. @deprecated As of Angstrom/Harland this method is unsupported.

isEnforced

public Query isEnforced(Schema schema)
                 throws StorageException
Matches documents that have the named schema enforced by the Storage implementation. Any documents with a schema enforced are guaranteed by any implementation to have a set of property values that meets the requirements of the schema.

isEnforced(s) implies conformsTo(s)


conformsTo

public Query conformsTo(Schema schema)
                 throws StorageException
Matches documents that conform to the named schema, that is, documents whose set of property values meets the requirements of the schema. A document may conform to a schema even if the Storage implementation is not enforcing the schema on the document.

conformsTo(s) does not imply isEnforced(s)


all

public Query all()
          throws StorageException
Matches all documents. This is a degenerate query predicate that is not recommended and may have very poor performance characteristics on some implementations. An all query is the only means by which an application may enumerate absolutely all documents regardless of property values and schema characteristics, without knowledge of ID allocation.

propertyExists

public Query propertyExists(String name)
                     throws StorageException
Matches documents having a value for the specified property name. In Bantam, a property exists on a document iff there is at least one value of the property on the document. Bantam has no concept of properties that exist but have no value.

propertyExists

public Query propertyExists(FieldDescriptor name)
                     throws StorageException
Matches documents having a value for the specified property name.
See Also:
propertyExists(String)

propertyEquals

public Query propertyEquals(String name,
                            Object value)
                     throws StorageException
Matches documents having the value of the named property equal to the specified value according to the semantics of Object.equals, with the following extensions: No type conversion or promotion will be performed. If the types of the property value and the user-provided constant value are not the same, the test is always true.

propertyEquals

public Query propertyEquals(FieldDescriptor name,
                            Object value)
                     throws StorageException
See Also:
propertyEquals(String, Object)

propertyEquals

public Query propertyEquals(String name,
                            String value)
                     throws StorageException
Deprecated. Use propertyEquals(String, Object) instead.

See Also:
propertyEquals(String, Object)

propertyEquals

public Query propertyEquals(FieldDescriptor name,
                            String value)
                     throws StorageException
Deprecated. Use propertyEquals(FieldDescriptor, Object) instead.

See Also:
propertyEquals(String, Object)

propertyNotEquals

public Query propertyNotEquals(String name,
                               Object value)
                        throws StorageException
Matches documents having the value of the named property which is not equal to the specified value according to the semantics of Object.equals, with the following extensions: No type conversion or promotion will be performed. If the types of the property value and the user-provided constant value are not the same, the test is always true.

propertyNotEquals

public Query propertyNotEquals(FieldDescriptor name,
                               Object value)
                        throws StorageException
See Also:
propertyNotEquals(String, Object)

propertyNotEquals

public Query propertyNotEquals(String name,
                               String value)
                        throws StorageException
Deprecated. Use propertyNotEquals(String, Object) instead.

See Also:
propertyNotEquals(String, Object)

propertyNotEquals

public Query propertyNotEquals(FieldDescriptor name,
                               String value)
                        throws StorageException
Deprecated. Use propertyNotEquals(FieldDescriptor, Object) instead.

See Also:
propertyNotEquals(String, Object)

propertyLessThan

public Query propertyLessThan(String name,
                              Comparable value)
                       throws StorageException
Matches documents having the value of the named property which is less than the specified value according to the semantics of Comparable.compareTo, with the following extensions:

propertyLessThan

public Query propertyLessThan(FieldDescriptor name,
                              Comparable value)
                       throws StorageException
See Also:
propertyLessThan(String, Comparable)

propertyLessThanEquals

public Query propertyLessThanEquals(String name,
                                    Comparable value)
                             throws StorageException
Matches documents having the value of the named property which is less than or equal to the specified value according to the semantics of Comparable.compareTo, with the following extensions:

propertyLessThanEquals

public Query propertyLessThanEquals(FieldDescriptor name,
                                    Comparable value)
                             throws StorageException
See Also:
propertyLessThanEquals(String, Comparable)

propertyGreaterThan

public Query propertyGreaterThan(String name,
                                 Comparable value)
                          throws StorageException
Matches documents having the value of the named property which is greater than the specified value according to the semantics of Java Comparable.compareTo, with the following extensions:

propertyGreaterThan

public Query propertyGreaterThan(FieldDescriptor name,
                                 Comparable value)
                          throws StorageException
See Also:
propertyGreaterThan(String, Comparable)

propertyGreaterThanEquals

public Query propertyGreaterThanEquals(String name,
                                       Comparable value)
                                throws StorageException
Matches documents having the value of the named property which is greater than or equal to the specified value according to the semantics of Java Comparable.compareTo(), with the following extensions:

propertyGreaterThanEquals

public Query propertyGreaterThanEquals(FieldDescriptor name,
                                       Comparable value)
                                throws StorageException
See Also:
propertyGreaterThanEquals(String, Comparable)

propertyEqualsIgnoreCase

public Query propertyEqualsIgnoreCase(String name,
                                      String value)
                               throws StorageException
Matches documents having the String value of the named property equal to the specified value without regard to case, that is, using the semantics of String.equalsIgnoreCase, with the following extensions:

propertyEqualsIgnoreCase

public Query propertyEqualsIgnoreCase(FieldDescriptor name,
                                      String value)
                               throws StorageException
See Also:
propertyEqualsIgnoreCase(String, String)

propertyContainsText

public Query propertyContainsText(String name,
                                  String substr)
                           throws StorageException
Matches documents having the supplied value as a substring of the String value of the named property. The test is equivalent to String.indexOf(substr) != -1, with the following extensions:

propertyContainsText

public Query propertyContainsText(FieldDescriptor name,
                                  String substr)
                           throws StorageException
See Also:
propertyContainsText(String, String)

propertyContainsTextIgnoreCase

public Query propertyContainsTextIgnoreCase(String name,
                                            String substr)
                                     throws StorageException
Matches documents having the supplied value as a substring of the String value of the named property, ignoring case. The test is equivalent to String.toUpperCase().indexOf(substr.toUpperCase()) != -1, with the following extensions:

propertyContainsTextIgnoreCase

public Query propertyContainsTextIgnoreCase(FieldDescriptor name,
                                            String substr)
                                     throws StorageException
See Also:
propertyContainsTextIgnoreCase(String, String)

propertyContains

public Query propertyContains(String name,
                              Object value)
                       throws StorageException
Matches documents having the specified value equal to at least one value of the named property according to the semantics of Object.equals, with the following extensions: No type conversion or promotion will be performed. If the types of the property value(s) and the user-provided constant value are not the same, the test is always false.

propertyContains

public Query propertyContains(FieldDescriptor name,
                              Object value)
                       throws StorageException
See Also:
propertyContains(String, Object)

textContains

public Query textContains(String value)
                   throws StorageException
Matches documents having the specified value as a substring of a text extraction of the content. It follows that this predicate matches only Bantam ContentDocuments. The algorithm by which text is extracted from various content types is implementation-specific. Implementation-specific query syntax may also be accepted within value.

and

public Query and(Query left,
                 Query right)
          throws StorageException
Boolean conjunction of two sub-queries: matches documents matched by both the right and left sub-queries.

or

public Query or(Query left,
                Query right)
         throws StorageException
Boolean disjunction of two sub-queries: matches documents matched by either the right or the left sub-query or both.

not

public Query not(Query query)
          throws StorageException
Boolean negation of a sub-query: matches documents not matched by the sub-query.

Project Harland