org.jooq.impl.SQLDataType Maven / Gradle / Ivy
/**
* Copyright (c) 2009-2016, Data Geekery GmbH (http://www.datageekery.com)
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq.impl;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Date;
import java.sql.ResultSet;
import java.sql.Time;
import java.sql.Timestamp;
import java.sql.Types;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.OffsetDateTime;
import java.time.OffsetTime;
import java.util.UUID;
import org.jooq.DataType;
import org.jooq.Record;
import org.jooq.Result;
import org.jooq.types.DayToSecond;
import org.jooq.types.UByte;
import org.jooq.types.UInteger;
import org.jooq.types.ULong;
import org.jooq.types.UShort;
import org.jooq.types.YearToMonth;
// ...
// ...
import org.jooq.util.cubrid.CUBRIDDataType;
// ...
import org.jooq.util.derby.DerbyDataType;
import org.jooq.util.firebird.FirebirdDataType;
import org.jooq.util.h2.H2DataType;
// ...
import org.jooq.util.hsqldb.HSQLDBDataType;
// ...
// ...
import org.jooq.util.mariadb.MariaDBDataType;
import org.jooq.util.mysql.MySQLDataType;
// ...
import org.jooq.util.postgres.PostgresDataType;
// ...
import org.jooq.util.sqlite.SQLiteDataType;
// ...
// ...
// ...
/**
* The SQL standard data types, as described in {@link Types}.
*
* These types are usually the ones that are referenced by generated source
* code. Most RDBMS have an almost 1:1 mapping between their vendor-specific
* types and the ones in this class (except Oracle). Some RDBMS also have
* extensions, e.g. for geospacial data types. See the dialect-specific data
* type classes for more information.
*
* @author Lukas Eder
*/
public final class SQLDataType {
// -------------------------------------------------------------------------
// String types
// -------------------------------------------------------------------------
/**
* The {@link Types#VARCHAR} type.
*/
public static final DataType VARCHAR = new DefaultDataType(null, String.class, "varchar");
/**
* The {@link Types#CHAR} type.
*/
public static final DataType CHAR = new DefaultDataType(null, String.class, "char");
/**
* The {@link Types#LONGVARCHAR} type.
*/
public static final DataType LONGVARCHAR = new DefaultDataType(null, String.class, "longvarchar");
/**
* The {@link Types#CLOB} type.
*/
public static final DataType CLOB = new DefaultDataType(null, String.class, "clob");
/**
* The {@link Types#NVARCHAR} type.
*/
public static final DataType NVARCHAR = new DefaultDataType(null, String.class, "nvarchar");
/**
* The {@link Types#NCHAR} type.
*/
public static final DataType NCHAR = new DefaultDataType(null, String.class, "nchar");
/**
* The {@link Types#LONGNVARCHAR} type.
*/
public static final DataType LONGNVARCHAR = new DefaultDataType(null, String.class, "longnvarchar");
/**
* The {@link Types#NCLOB} type.
*/
public static final DataType NCLOB = new DefaultDataType(null, String.class, "nclob");
// -------------------------------------------------------------------------
// Boolean types
// -------------------------------------------------------------------------
/**
* The {@link Types#BOOLEAN} type.
*/
public static final DataType BOOLEAN = new DefaultDataType(null, Boolean.class, "boolean");
/**
* The {@link Types#BIT} type.
*/
public static final DataType BIT = new DefaultDataType(null, Boolean.class, "bit");
// -------------------------------------------------------------------------
// Integer types
// -------------------------------------------------------------------------
/**
* The {@link Types#TINYINT} type.
*/
public static final DataType TINYINT = new DefaultDataType(null, Byte.class, "tinyint");
/**
* The {@link Types#SMALLINT} type.
*/
public static final DataType SMALLINT = new DefaultDataType(null, Short.class, "smallint");
/**
* The {@link Types#INTEGER} type.
*/
public static final DataType INTEGER = new DefaultDataType(null, Integer.class, "integer");
/**
* The {@link Types#BIGINT} type.
*/
public static final DataType BIGINT = new DefaultDataType(null, Long.class, "bigint");
/**
* The zero-scale {@link Types#DECIMAL} type.
*/
public static final DataType DECIMAL_INTEGER = new DefaultDataType(null, BigInteger.class, "decimal_integer");
// -------------------------------------------------------------------------
// Unsigned integer types
// -------------------------------------------------------------------------
/**
* The unsigned {@link Types#TINYINT} type.
*/
public static final DataType TINYINTUNSIGNED = new DefaultDataType(null, UByte.class, "tinyint unsigned");
/**
* The unsigned {@link Types#SMALLINT} type.
*/
public static final DataType SMALLINTUNSIGNED = new DefaultDataType(null, UShort.class, "smallint unsigned");
/**
* The unsigned {@link Types#INTEGER} type.
*/
public static final DataType INTEGERUNSIGNED = new DefaultDataType(null, UInteger.class, "integer unsigned");
/**
* The unsigned {@link Types#BIGINT} type.
*/
public static final DataType BIGINTUNSIGNED = new DefaultDataType(null, ULong.class, "bigint unsigned");
// -------------------------------------------------------------------------
// Floating point types
// -------------------------------------------------------------------------
/**
* The {@link Types#DOUBLE} type.
*/
public static final DataType DOUBLE = new DefaultDataType(null, Double.class, "double");
/**
* The {@link Types#FLOAT} type.
*/
public static final DataType FLOAT = new DefaultDataType(null, Double.class, "float");
/**
* The {@link Types#REAL} type.
*/
public static final DataType REAL = new DefaultDataType(null, Float.class, "real");
// -------------------------------------------------------------------------
// Numeric types
// -------------------------------------------------------------------------
/**
* The {@link Types#NUMERIC} type.
*/
public static final DataType NUMERIC = new DefaultDataType(null, BigDecimal.class, "numeric");
/**
* The {@link Types#DECIMAL} type.
*/
public static final DataType DECIMAL = new DefaultDataType(null, BigDecimal.class, "decimal");
// -------------------------------------------------------------------------
// Datetime types
// -------------------------------------------------------------------------
/**
* The {@link Types#DATE} type.
*/
public static final DataType DATE = new DefaultDataType(null, Date.class, "date");
/**
* The {@link Types#TIMESTAMP} type.
*/
public static final DataType TIMESTAMP = new DefaultDataType(null, Timestamp.class, "timestamp");
/**
* The {@link Types#TIME} type.
*/
public static final DataType