org.jpox.store.expression
Interface ExpressionMethodAdapter

All Known Subinterfaces:
DatastoreAdapter, RDBMSAdapter
All Known Implementing Classes:
AbstractDatastoreAdapter, DatabaseAdapter

public interface ExpressionMethodAdapter

Interface that allows one datastore adapt operations

Version:
$Revision: 1.9 $

Method Summary
 NumericExpression absMethod(ScalarExpression expr)
          Returns the absolute expression for the JDOQL Math.abs(EXPRESSION) method.
 NumericExpression acosMethod(ScalarExpression expr)
          Returns the expression for the JDOQL Math.acos(EXPRESSION) method.
 NumericExpression asinMethod(ScalarExpression expr)
          Returns the expression for the JDOQL Math.asin(EXPRESSION) method.
 NumericExpression atanMethod(ScalarExpression expr)
          Returns the expression for the JDOQL Math.tan(EXPRESSION) method.
 NumericExpression ceilMethod(ScalarExpression expr)
          Returns the expression for the JDOQL Math.ceil(EXPRESSION) method.
 NumericExpression cosMethod(ScalarExpression expr)
          Returns the expression for the JDOQL Math.cos(EXPRESSION) method.
 BooleanExpression endsWithMethod(ScalarExpression leftOperand, ScalarExpression rightOperand)
          Returns whether this string ends with the specified string.
 NumericExpression expMethod(ScalarExpression expr)
          Returns the expression for the JDOQL Math.exp(EXPRESSION) method.
 NumericExpression floorMethod(ScalarExpression expr)
          Returns the expression for the JDOQL Math.floor(EXPRESSION) method.
 NumericExpression getDayMethod(SqlTemporalExpression source)
          Method to handle the Date.getDay() method in JDOQL.
 NumericExpression getHourMethod(SqlTemporalExpression source)
          Method to handle the Time.getHour() method in JDOQL.
 NumericExpression getMinuteMethod(SqlTemporalExpression source)
          Method to handle the Time.getMinute() method in JDOQL.
 NumericExpression getMonthMethod(SqlTemporalExpression source)
          Method to handle the Date.getMonth() method in JDOQL.
 NumericExpression getSecondMethod(SqlTemporalExpression source)
          Method to handle the Time.getSecond() method in JDOQL.
 NumericExpression getYearMethod(SqlTemporalExpression source)
          Method to handle the Date.getYear() method in JDOQL.
 NumericExpression indexOfMethod(ScalarExpression source, ScalarExpression str, NumericExpression from)
          Method to handle the indexOf operation.
 NumericExpression lengthMethod(StringExpression str)
          Returns the expression for the JDOQL String.length() method.
 NumericExpression logMethod(ScalarExpression expr)
          Returns the expression for the JDOQL Math.log(EXPRESSION) method.
 NumericExpression sinMethod(ScalarExpression expr)
          Returns the expression for the JDOQL Math.sin(EXPRESSION) method.
 NumericExpression sqrtMethod(ScalarExpression expr)
          Returns the expression for the JDOQL Math.sqrt(EXPRESSION) method.
 BooleanExpression startsWithMethod(ScalarExpression source, ScalarExpression str)
          Method to handle the starts with operation.
 StringExpression substringMethod(StringExpression str, NumericExpression begin)
          Returns the expression for the JDOQL String.substring(str,begin) method.
 StringExpression substringMethod(StringExpression str, NumericExpression begin, NumericExpression end)
          Returns the expression for the JDOQL String.substring(str,begin,end) method.
 NumericExpression tanMethod(ScalarExpression expr)
          Returns the expression for the JDOQL Math.tan(EXPRESSION) method.
 StringExpression trimMethod(StringExpression str)
          Returns the expression for the JDOQL String.trim(str) method.
 

Method Detail

absMethod

public NumericExpression absMethod(ScalarExpression expr)
Returns the absolute expression for the JDOQL Math.abs(EXPRESSION) method. In SQL, it may compile to:

 ABS(str)
 

Parameters:
expr - The argument to the abs() method.
Returns:
The expression.

sqrtMethod

public NumericExpression sqrtMethod(ScalarExpression expr)
Returns the expression for the JDOQL Math.sqrt(EXPRESSION) method. In SQL, it may compile to:

 SQRT(str)
 

Parameters:
expr - The argument to the sqrt() method.
Returns:
The expression.

cosMethod

public NumericExpression cosMethod(ScalarExpression expr)
Returns the expression for the JDOQL Math.cos(EXPRESSION) method. In SQL, it may compile to:

 COS(str)
 

Parameters:
expr - The argument to the cos() method.
Returns:
The expression.

sinMethod

public NumericExpression sinMethod(ScalarExpression expr)
Returns the expression for the JDOQL Math.sin(EXPRESSION) method. In SQL, it may compile to:

 SIN(str)
 

Parameters:
expr - The argument to the sin() method.
Returns:
The expression.

tanMethod

public NumericExpression tanMethod(ScalarExpression expr)
Returns the expression for the JDOQL Math.tan(EXPRESSION) method. In SQL, it may compile to:

 TAN(str)
 

Parameters:
expr - The argument to the tan() method.
Returns:
The expression.

acosMethod

public NumericExpression acosMethod(ScalarExpression expr)
Returns the expression for the JDOQL Math.acos(EXPRESSION) method. In SQL, it may compile to:

 ACOS(str)
 

Parameters:
expr - The argument to the cos() method.
Returns:
The expression.

asinMethod

public NumericExpression asinMethod(ScalarExpression expr)
Returns the expression for the JDOQL Math.asin(EXPRESSION) method. In SQL, it may compile to:

 ASIN(str)
 

Parameters:
expr - The argument to the asin() method.
Returns:
The expression.

atanMethod

public NumericExpression atanMethod(ScalarExpression expr)
Returns the expression for the JDOQL Math.tan(EXPRESSION) method. In SQL, it may compile to:

 ATAN(str)
 

Parameters:
expr - The argument to the atan() method.
Returns:
The expression.

endsWithMethod

public BooleanExpression endsWithMethod(ScalarExpression leftOperand,
                                        ScalarExpression rightOperand)
Returns whether this string ends with the specified string.

Parameters:
leftOperand - the source string
rightOperand - The string to compare against.
Returns:
Whether it ends with the string.

expMethod

public NumericExpression expMethod(ScalarExpression expr)
Returns the expression for the JDOQL Math.exp(EXPRESSION) method. In SQL, it may compile to:

 EXP(str)
 

Parameters:
expr - The argument to the exp() method.
Returns:
The expression.

logMethod

public NumericExpression logMethod(ScalarExpression expr)
Returns the expression for the JDOQL Math.log(EXPRESSION) method. In SQL, it may compile to:

 LOG(str)
 

Parameters:
expr - The argument to the log() method.
Returns:
The expression.

floorMethod

public NumericExpression floorMethod(ScalarExpression expr)
Returns the expression for the JDOQL Math.floor(EXPRESSION) method. In SQL, it may compile to:

 FLOOR(str)
 

Parameters:
expr - The argument to the floor() method.
Returns:
The expression.

ceilMethod

public NumericExpression ceilMethod(ScalarExpression expr)
Returns the expression for the JDOQL Math.ceil(EXPRESSION) method. In SQL, it may compile to:

 CEIL(str)
 

Parameters:
expr - The argument to the ceil() method.
Returns:
The expression.

lengthMethod

public NumericExpression lengthMethod(StringExpression str)
Returns the expression for the JDOQL String.length() method. In SQL, it may compile to:

 CHAR_LENGTH(str)
 

Parameters:
str - The argument to the length() method.
Returns:
The expression.

substringMethod

public StringExpression substringMethod(StringExpression str,
                                        NumericExpression begin)
Returns the expression for the JDOQL String.substring(str,begin) method. In SQL, it may compile to:

 SUBSTRING(str FROM begin)
 
Note that the value of begin is base 0(Java-style), while most SQL string functions use base 1.

Parameters:
str - The first argument to the substring() method.
begin - The second argument to the substring() method.
Returns:
The expression.

substringMethod

public StringExpression substringMethod(StringExpression str,
                                        NumericExpression begin,
                                        NumericExpression end)
Returns the expression for the JDOQL String.substring(str,begin,end) method. In SQL, it may compile to:

 SUBSTRING(str FROM begin FOR len)
 
Note that the value of begin is base 0 (Java-style), while most SQL string functions use base 1. Note also that an end position is given, while most SQL substring functions take a length.

Parameters:
str - The first argument to the substring() method.
begin - The second argument to the substring() method.
end - The third argument to the substring() method.
Returns:
The expression.

startsWithMethod

public BooleanExpression startsWithMethod(ScalarExpression source,
                                          ScalarExpression str)
Method to handle the starts with operation.

Parameters:
source - The expression with the searched string
str - The expression for the search string
Returns:
The expression.

indexOfMethod

public NumericExpression indexOfMethod(ScalarExpression source,
                                       ScalarExpression str,
                                       NumericExpression from)
Method to handle the indexOf operation.

Parameters:
source - The expression with the searched string
str - The expression for the search string
from - Position to start searching from
Returns:
The expression.

trimMethod

public StringExpression trimMethod(StringExpression str)
Returns the expression for the JDOQL String.trim(str) method. In SQL, it may compile to:

 TRIM(str)
 

Parameters:
str - The first argument to the trim() method.
Returns:
The expression.

getDayMethod

public NumericExpression getDayMethod(SqlTemporalExpression source)
Method to handle the Date.getDay() method in JDOQL.

Parameters:
source - The date expression to find the day of month for
Returns:
The expression for the day of the month.

getMonthMethod

public NumericExpression getMonthMethod(SqlTemporalExpression source)
Method to handle the Date.getMonth() method in JDOQL.

Parameters:
source - The date expression to find the month for
Returns:
The expression for the month.

getYearMethod

public NumericExpression getYearMethod(SqlTemporalExpression source)
Method to handle the Date.getYear() method in JDOQL.

Parameters:
source - The date expression to find the year for
Returns:
The expression for the year.

getHourMethod

public NumericExpression getHourMethod(SqlTemporalExpression source)
Method to handle the Time.getHour() method in JDOQL.

Parameters:
source - The time expression to find the hour for
Returns:
The expression for the hour.

getMinuteMethod

public NumericExpression getMinuteMethod(SqlTemporalExpression source)
Method to handle the Time.getMinute() method in JDOQL.

Parameters:
source - The time expression to find the minute for
Returns:
The expression for the minute.

getSecondMethod

public NumericExpression getSecondMethod(SqlTemporalExpression source)
Method to handle the Time.getSecond() method in JDOQL.

Parameters:
source - The time expression to find the second for
Returns:
The expression for the second.


Copyright © -2007 . All Rights Reserved.