1 package org.apache.torque.templates.typemapping; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import java.sql.Types; 23 24 /** 25 * Enum for known SQL types. 26 * 27 * @author <a href="mailto:mpoeschl@marmot.at>Martin Poeschl</a> 28 * @version $Id: SchemaType.java 1331196 2012-04-27 02:56:12Z tfischer $ 29 */ 30 public enum SchemaType 31 { 32 /** JDBC Datatype BIT. */ 33 BIT(Types.BIT), 34 /** JDBC Datatype TINYINT. */ 35 TINYINT(Types.TINYINT), 36 /** JDBC Datatype SMALLINT. */ 37 SMALLINT(Types.SMALLINT), 38 /** JDBC Datatype INTEGER. */ 39 INTEGER(Types.INTEGER), 40 /** JDBC Datatype BIGINT. */ 41 BIGINT(Types.BIGINT), 42 /** JDBC Datatype FLOAT. */ 43 FLOAT(Types.FLOAT), 44 /** JDBC Datatype REAL. */ 45 REAL(Types.REAL), 46 /** JDBC Datatype NUMERIC. */ 47 NUMERIC(Types.NUMERIC), 48 /** JDBC Datatype DECIMAL. */ 49 DECIMAL(Types.DECIMAL), 50 /** JDBC Datatype CHAR. */ 51 CHAR(Types.CHAR), 52 /** JDBC Datatype VARCHAR. */ 53 VARCHAR(Types.VARCHAR), 54 /** JDBC Datatype LONGVARCHAR. */ 55 LONGVARCHAR(Types.LONGVARCHAR), 56 /** JDBC Datatype DATE. */ 57 DATE(Types.DATE), 58 /** JDBC Datatype TIME. */ 59 TIME(Types.TIME), 60 /** JDBC Datatype TIMESTAMP. */ 61 TIMESTAMP(Types.TIMESTAMP), 62 /** JDBC Datatype BINARY. */ 63 BINARY(Types.BINARY), 64 /** JDBC Datatype VARBINARY. */ 65 VARBINARY(Types.VARBINARY), 66 /** JDBC Datatype LONGVARBINARY. */ 67 LONGVARBINARY(Types.LONGVARBINARY), 68 /** JDBC Datatype NULL. */ 69 NULL(Types.NULL), 70 /** JDBC Datatype OTHER. */ 71 OTHER(Types.OTHER), 72 /** JDBC Datatype JAVA_OBJECT. */ 73 JAVA_OBJECT(Types.JAVA_OBJECT), 74 /** JDBC Datatype DISTINCT. */ 75 DISTINCT(Types.DISTINCT), 76 /** JDBC Datatype STRUCT. */ 77 STRUCT(Types.STRUCT), 78 /** JDBC Datatype ARRAY. */ 79 ARRAY(Types.ARRAY), 80 /** JDBC Datatype BLOB. */ 81 BLOB(Types.BLOB), 82 /** JDBC Datatype CLOB. */ 83 CLOB(Types.CLOB), 84 /** JDBC Datatype REF. */ 85 REF(Types.REF), 86 /** JDBC Datatype INTEGER interpreted as Boolean. */ 87 BOOLEANINT(Types.INTEGER), 88 /** JDBC Datatype CHAR interpreted as Boolean. */ 89 BOOLEANCHAR(Types.CHAR), 90 /** JDBC Datatype DOUBLE. */ 91 DOUBLE(Types.DOUBLE); 92 93 /** 94 * The corresponding jdbc type, 95 * may be null if no corresponding type exists. 96 */ 97 private Integer jdbcType; 98 99 private SchemaType(Integer jdbcType) 100 { 101 this.jdbcType = jdbcType; 102 } 103 104 /** 105 * Returns the corresponding jdbc type. 106 * 107 * @return the corresponding jdbc type, or null if no corresponding 108 * type exists. 109 */ 110 public Integer getJdbcType() 111 { 112 return jdbcType; 113 } 114 }