01: /**********************************************************************
02: Copyright (c) 2003 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: import java.sql.Time;
20:
21: import org.jpox.store.mapping.JavaTypeMapping;
22:
23: /**
24: * Representation of an SQLTime literal in a Query.
25: *
26: * @version $Revision: 1.5 $
27: **/
28: public class SqlTimeLiteral extends SqlTemporalExpression implements
29: Literal {
30: private final Time value;
31:
32: /** Raw value that this literal represents. */
33: Object rawValue;
34:
35: /**
36: * Creates a java.sql.Time literal
37: * @param qs the QueryExpression
38: * @param mapping the mapping
39: * @param value the java.sql.Time value
40: */
41: public SqlTimeLiteral(QueryExpression qs, JavaTypeMapping mapping,
42: Time value) {
43: super (qs);
44: this .mapping = mapping;
45: this .value = value;
46: st.appendParameter(mapping, value);
47: }
48:
49: public String toString() {
50: return super .toString() + " = " + value.toString();
51: }
52:
53: public Object getValue() {
54: return value;
55: }
56:
57: /**
58: * Method to save a "raw" value that this literal represents.
59: * This value differs from the literal value since that is of the same type as this literal.
60: * @param val The raw value
61: */
62: public void setRawValue(Object val) {
63: this .rawValue = val;
64: }
65:
66: /**
67: * Accessor for the "raw" value that this literal represents.
68: * This value differs from the literal value since that is of the same type as this literal.
69: * @return The raw value
70: */
71: public Object getRawValue() {
72: return rawValue;
73: }
74: }
|