01: /**********************************************************************
02: Copyright (c) 2002 Kelly Grizzle (TJDO) 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: 2002 Mike Martin (TJDO)
17: 2003 Andy Jefferson - coding standards
18: ...
19: **********************************************************************/package org.jpox.store.expression;
20:
21: import org.jpox.store.mapping.JavaTypeMapping;
22:
23: /**
24: * Representation of a BooleanBit column literal in a Query.
25: *
26: * @version $Revision: 1.6 $
27: **/
28: public class BooleanBitColumnLiteral extends BooleanLiteral {
29: /**
30: * Constructor.
31: * @param qs the QueryExpression
32: * @param mapping the mapping associated to this expression
33: * @param value the literal value
34: */
35: public BooleanBitColumnLiteral(QueryExpression qs,
36: JavaTypeMapping mapping, boolean value) {
37: super (qs, mapping, value);
38: }
39:
40: /**
41: * Return the String value for TRUE in the database. This should be
42: * overriden by subclasses for special cases of booleans.
43: *
44: * @return The String value for TRUE in the database.
45: */
46: protected String getBooleanTrueValue() {
47: return Integer.toString(1);
48: }
49:
50: /**
51: * Return the String value for FALSE in the database. This should be
52: * overriden by subclasses for special cases of booleans.
53: *
54: * @return The String value for FALSE in the database.
55: */
56: protected String getBooleanFalseValue() {
57: return Integer.toString(0);
58: }
59: }
|