View Javadoc

1   package org.apache.ojb.broker.platforms;
2   
3   /* Copyright 2002-2005 The Apache Software Foundation
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License");
6    * you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    *
9    *     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  /**
20   * This class extends <code>PlatformDefaultImpl</code> and defines specific
21   * behavior for the Hsqldb platform.
22   *
23   * @author <a href="mailto:thma@apache.org">Thomas Mahler<a>
24   * @version $Id: PlatformHsqldbImpl.java,v 1.1 2007-08-24 22:17:35 ewestfal Exp $
25   */
26  public class PlatformHsqldbImpl extends PlatformDefaultImpl
27  {
28      private static final String LAST_INSERT = "CALL IDENTITY()";
29  
30      /**
31       * Get join syntax type for this RDBMS - one on of the constants from JoinSyntaxType interface
32       */
33      public byte getJoinSyntaxType()
34      {
35          return SQL92_NOPAREN_JOIN_SYNTAX;
36      }
37  
38      public String getLastInsertIdentityQuery(String tableName)
39      {
40          return LAST_INSERT;
41      }
42      
43      /* (non-Javadoc)
44       * @see org.apache.ojb.broker.platforms.Platform#addPagingSql(java.lang.StringBuffer)
45       */
46      public void addPagingSql(StringBuffer anSqlString)
47      {
48          anSqlString.insert(6, " LIMIT ? ? ");
49      }
50  
51      /* (non-Javadoc)
52       * @see org.apache.ojb.broker.platforms.Platform#bindPagingParametersFirst()
53       */
54      public boolean bindPagingParametersFirst()
55      {
56          return true;
57      }
58  
59      /* (non-Javadoc)
60       * @see org.apache.ojb.broker.platforms.Platform#supportsPaging()
61       */
62      public boolean supportsPaging()
63      {
64          return true;
65      }
66  
67  // arminw: Check is not necessary any longer
68  //    /**
69  //     * HSQLDB does not implement CallableStatement.
70  //     *
71  //     * @see org.apache.ojb.broker.platforms.Platform#isCallableStatement(java.sql.PreparedStatement)
72  //     */
73  //    public boolean isCallableStatement(PreparedStatement stmt)
74  //    {
75  //        return false;
76  //    }
77  
78  }