01: /**********************************************************************
02: Copyright (c) 2008 Andy Jefferson and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15: Contributors:
16: ...
17: **********************************************************************/package org.jpox.store.expression;
18:
19: /**
20: * Representation of temporal functions in java query languages.
21: * @version $Revision: 1.11 $
22: */
23: public class TemporalExpression extends ScalarExpression {
24: /**
25: * @param qs The query statement
26: */
27: public TemporalExpression(QueryExpression qs) {
28: super (qs);
29: }
30:
31: /**
32: * Returns the current date as an expression.
33: * @return the result in a ScalarExpression instance
34: */
35: public ScalarExpression currentDateMethod() {
36: return qs.getStoreManager().getDatastoreAdapter()
37: .getCurrentDateMethod(qs);
38: }
39:
40: /**
41: * Returns the current time as an expression.
42: * @return the result in a ScalarExpression instance
43: */
44: public ScalarExpression currentTimeMethod() {
45: return qs.getStoreManager().getDatastoreAdapter()
46: .getCurrentTimeMethod(qs);
47: }
48:
49: /**
50: * Returns the current timestamp as an expression.
51: * @return the result in a ScalarExpression instance
52: */
53: public ScalarExpression currentTimestampMethod() {
54: return qs.getStoreManager().getDatastoreAdapter()
55: .getCurrentTimestampMethod(qs);
56: }
57: }
|