Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/jdbf/engine/sql/InterbaseInterface.java


1   /*
2    * 20/01/2003 - 10:22:45
3    *
4    * InterbaseInterface.java - JDBF Object Relational mapping system
5    * Copyright (C) 2002 Giovanni Martone
6    * giovannimartone@hotmail.com
7    * http://jdbf.sourceforge.net
8    *
9    * This program is free software; you can redistribute it and/or
10   * modify it under the terms of the GNU Lesser General Public License
11   * as published by the Free Software Foundation; either version 2
12   * of the License, or (at your option) any later version.
13   *
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU Lesser General Public License for more details.
18   *
19   * You should have received a copy of the GNU Lesser General Public License
20   * along with this program; if not, write to the Free Software
21   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22   */
23  package org.jdbf.engine.sql;
24  
25  import org.jdbf.engine.mapping.MappingException;
26  
27  
28  /** 
29   * It's overrides SqlInterface's methods for constructing sql statements  
30   * where Interbase's implementaion differs from ANSI or is not specified by ANSI.
31   *
32   * @author  Giovanni Martone
33   * ver. $id$
34   * 
35   */
36  public class InterbaseInterface extends SqlInterface{
37      
38    
39    /**
40       *  Return the lower function.
41     *
42     *  Interbase has not the "Lower" function
43     *
44     * @return string in lower case
45     * @throws MappingExcpetion
46       */
47      public String getClauseStringLower() throws MappingException{
48      throw new MappingException("mapping.dbFeatureNotSupported");
49      }
50  
51      
52    /**
53     * Return the current timeStamp statement
54     *
55     * @return current timestamp statement
56     * @overrides SqlInterface.getCurrentTimeStampStatement
57     */
58    public String getCurrentTimeStampStatement()throws MappingException{
59      return "select current_timestamp from rdb$database;";
60      }
61  
62        
63    /**
64       * Forms an sql sequence statement given name
65     *
66     * This method throws an MappingExcpetion because for a generic sql interface
67     * the sequence feature is not supported.
68     * @see OracleInterface.getSelectSequenceStatement
69     *
70     * @param name
71     * @return Sql statement for selecting a sequence key.
72     * @throws MappingException
73     *
74       */
75      public String getSelectSequenceStatement(String name)throws MappingException{
76      return new StringBuffer("select gen_id(").append(name)
77        .append(",1) from rdb$database").toString();
78      }
79  }