001: /*
002: * Created on Jun 5, 2005
003: *
004: */
005: package com.jofti.query;
006:
007: /**
008: *
009: *
010: * A utility class to enable simple queries to be done easily. The Query matches everything larger than the
011: * value passed in for that particular field. The optional inclusive flag allows the behaviour to be either >= or just >.
012: * <p>
013: *
014: * This query cannot be combined with any other. iF you want to construct more complex queries use the @link com.jofti.query.Query class.
015: *<p>
016: * @author Steve Woodcock
017: */
018: public class MatchLargerQuery extends MatchRangeQuery {
019:
020: /**
021: * Construct a query supplying the classname of the object type to be returned, the
022: * field to be queried and the value to be used. <p>
023: *
024: * The field type in the object and the value must be of the same type.
025: * <p>
026: * It is assumed that the search is inclusive.
027: * <p>
028: * An example usage would be:
029: * <p>
030: * new MatchLargerQuery(org.package.Myclass.class, "myProperty" ,"some value");
031: * <p>
032: * @param className - the class of object to be returned.
033: * @param propertyName - the field name to use
034: * @param value - the value that is used as the search value.
035: */
036:
037: public MatchLargerQuery(Class className, String propertyName,
038: Comparable value) {
039: super (className, propertyName, value, null, null);
040: }
041:
042: public MatchLargerQuery(Class className, String propertyName,
043: Comparable value, Object alias) {
044: super (className, propertyName, value, null, alias);
045: }
046:
047: /**
048: * Construct a query supplying the classname of the object type to be returned, the
049: * field to be queried and the value to be used. <p>
050: *
051: * The field type in the object and the value must be of the same type.
052: * <p>
053: * It is assumed that the search is inclusive.
054: * <p>
055: * An example usage would be:
056: * <p>
057: * new MatchLargerQuery("org.package.Myclass", "myProperty" ,"some value");
058: * <p>
059: * @param className - the class of object to be returned.
060: * @param propertyName - the field name to use
061: * @param value - the value that is used as the search value.
062: */
063: public MatchLargerQuery(String className, String propertyName,
064: Comparable value) {
065: super (className, propertyName, value, null, null);
066: }
067:
068: public MatchLargerQuery(String className, String propertyName,
069: Comparable value, Object alias) {
070: super (className, propertyName, value, null, alias);
071: }
072:
073: /**
074: * Construct a query supplying the classname of the object type to be returned, the
075: * field to be queried and the value to be used. The method
076: * also allows control of whether the query is inclusive of the value or not.
077: * <p>
078: * The field type in the object and the value must be of the same type.
079: * <p>
080: * An example usage would be:
081: * <p>
082: * new MatchLargerQuery("org.package.Myclass", "myProperty" ,"some value");
083: * <p>
084: * @param className - the class of object to be returned.
085: * @param propertyName - the field name to use
086: * @param value - the value that is used as the search value.
087: * @param inclusive - indicates if the value is to be inclusive in range.
088: */
089: public MatchLargerQuery(Class className, String propertyName,
090: Comparable value, boolean inclusive) {
091: super (className, propertyName, value, null, inclusive, null);
092: }
093:
094: public MatchLargerQuery(Class className, String propertyName,
095: Comparable value, boolean inclusive, Object alias) {
096: super (className, propertyName, value, null, inclusive, alias);
097: }
098:
099: public MatchLargerQuery(String className, String propertyName,
100: Comparable value, boolean inclusive) {
101: super (className, propertyName, value, null, inclusive, null);
102: }
103:
104: public MatchLargerQuery(String className, String propertyName,
105: Comparable value, boolean inclusive, Object alias) {
106: super (className, propertyName, value, null, inclusive, alias);
107: }
108:
109: /**
110: * Construct a query supplying the value to be searched against.
111: * This is a convenience method for classes (such as String,Integer etc)
112: * that have no property value as such. Instead the value is the class type.
113: * <p>
114: *
115: * An example usage would be:
116: * <p>
117: * new MatchLargerQuery("some value",true);
118: * <p>
119: * This is so you do not have to use the methods above in the manner of
120: * <p>
121: * new MatchLargerQuery("java.lang.String", null ,"some value");
122: * <p>
123:
124: * @param value - the value that is used as the search value.
125: * @param inclusive - indicates if the value is to be inclusive in range.
126: */
127: public MatchLargerQuery(Comparable value, boolean inclusive) {
128: super (value, null, inclusive, null);
129: }
130:
131: public MatchLargerQuery(Comparable value, boolean inclusive,
132: Object alias) {
133: super(value, null, inclusive, alias);
134: }
135: }
|