01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.lucene.store.jdbc.dialect;
18:
19: /**
20: * A HSQL dialect.
21: *
22: * @author kimchy
23: */
24: public class HSQLDialect extends Dialect {
25:
26: /**
27: * HSQL does not support select ... for update.
28: */
29: public boolean supportsForUpdate() {
30: return false;
31: }
32:
33: public String getForUpdateString() {
34: return "";
35: }
36:
37: /**
38: * HSQL supports transactional scoped blobs.
39: */
40: public boolean supportTransactionalScopedBlobs() {
41: return true;
42: }
43:
44: /**
45: * HSQL supports if exists after the table name.
46: */
47: public boolean supportsIfExistsAfterTableName() {
48: return true;
49: }
50:
51: public String getVarcharType(int length) {
52: return "varchar(" + length + ")";
53: }
54:
55: public String getBlobType(long length) {
56: return "longvarbinary";
57: }
58:
59: public String getNumberType() {
60: return "integer";
61: }
62:
63: public String getTimestampType() {
64: return "timestamp";
65: }
66:
67: public String getCurrentTimestampFunction() {
68: return "now()";
69: }
70:
71: public String getBitType() {
72: return "bit";
73: }
74: }
|