01: package org.apache.ojb.broker.platforms;
02:
03: /* Copyright 2002-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * This class extends <code>PlatformDefaultImpl</code> and defines specific
20: * behavior for the Hsqldb platform.
21: *
22: * @author <a href="mailto:thma@apache.org">Thomas Mahler<a>
23: * @version $Id: PlatformHsqldbImpl.java,v 1.7.2.3 2005/08/16 15:04:39 aclute Exp $
24: */
25: public class PlatformHsqldbImpl extends PlatformDefaultImpl {
26: private static final String LAST_INSERT = "CALL IDENTITY()";
27:
28: /**
29: * Get join syntax type for this RDBMS - one on of the constants from JoinSyntaxType interface
30: */
31: public byte getJoinSyntaxType() {
32: return SQL92_NOPAREN_JOIN_SYNTAX;
33: }
34:
35: public String getLastInsertIdentityQuery(String tableName) {
36: return LAST_INSERT;
37: }
38:
39: /* (non-Javadoc)
40: * @see org.apache.ojb.broker.platforms.Platform#addPagingSql(java.lang.StringBuffer)
41: */
42: public void addPagingSql(StringBuffer anSqlString) {
43: anSqlString.insert(6, " LIMIT ? ? ");
44: }
45:
46: /* (non-Javadoc)
47: * @see org.apache.ojb.broker.platforms.Platform#bindPagingParametersFirst()
48: */
49: public boolean bindPagingParametersFirst() {
50: return true;
51: }
52:
53: /* (non-Javadoc)
54: * @see org.apache.ojb.broker.platforms.Platform#supportsPaging()
55: */
56: public boolean supportsPaging() {
57: return true;
58: }
59:
60: // arminw: Check is not necessary any longer
61: // /**
62: // * HSQLDB does not implement CallableStatement.
63: // *
64: // * @see org.apache.ojb.broker.platforms.Platform#isCallableStatement(java.sql.PreparedStatement)
65: // */
66: // public boolean isCallableStatement(PreparedStatement stmt)
67: // {
68: // return false;
69: // }
70:
71: }
|