All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jooq.util.mysql.MySQLDataType Maven / Gradle / Ivy

There is a newer version: 3.19.11
Show newest version
/**
 * 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.util.mysql;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.UUID;

import org.jooq.DataType;
import org.jooq.SQLDialect;
import org.jooq.impl.DefaultDataType;
import org.jooq.impl.SQLDataType;
import org.jooq.types.UByte;
import org.jooq.types.UInteger;
import org.jooq.types.ULong;
import org.jooq.types.UShort;

/**
 * Supported data types for the {@link SQLDialect#MYSQL} dialect
 *
 * @author Lukas Eder
 * @see http://dev.mysql.com/doc/refman/5.5/en/data-types.html
 * @see http://dev.mysql.com/doc/refman/5.5/en/cast-functions.html#function_cast
 */
public class MySQLDataType {

    // -------------------------------------------------------------------------
    // Default SQL data types and synonyms thereof
    // -------------------------------------------------------------------------

    public static final DataType       TINYINT            = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.TINYINT, "tinyint", "signed");
    public static final DataType      TINYINTUNSIGNED    = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.TINYINTUNSIGNED, "tinyint unsigned", "unsigned");
    public static final DataType      SMALLINT           = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.SMALLINT, "smallint", "signed");
    public static final DataType     SMALLINTUNSIGNED   = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.SMALLINTUNSIGNED, "smallint unsigned", "unsigned");
    public static final DataType    INT                = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.INTEGER, "int", "signed");
    public static final DataType   INTUNSIGNED        = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.INTEGERUNSIGNED, "int unsigned", "unsigned");
    public static final DataType    MEDIUMINT          = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.INTEGER, "mediumint", "signed");
    public static final DataType   MEDIUMINTUNSIGNED  = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.INTEGERUNSIGNED, "mediumint unsigned", "unsigned");
    public static final DataType    INTEGER            = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.INTEGER, "integer", "signed");
    public static final DataType   INTEGERUNSIGNED    = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.INTEGERUNSIGNED, "integer unsigned", "unsigned");
    public static final DataType       BIGINT             = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.BIGINT, "bigint", "signed");
    public static final DataType      BIGINTUNSIGNED     = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.BIGINTUNSIGNED, "bigint unsigned", "unsigned");
    public static final DataType     DOUBLE             = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.DOUBLE, "double", "decimal");
    public static final DataType     FLOAT              = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.FLOAT, "float", "decimal");
    public static final DataType      REAL               = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.REAL, "real", "decimal");
    public static final DataType    BOOLEAN            = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.BOOLEAN, "boolean", "unsigned");
    public static final DataType    BOOL               = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.BOOLEAN, "bool", "unsigned");
    public static final DataType    BIT                = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.BIT, "bit", "unsigned");
    public static final DataType DECIMAL            = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.DECIMAL, "decimal", "decimal");
    public static final DataType DEC                = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.DECIMAL, "dec", "decimal");
    public static final DataType     VARCHAR            = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.VARCHAR, "varchar", "char");
    public static final DataType     CHAR               = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.CHAR, "char", "char");
    public static final DataType     BLOB               = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.BLOB, "blob", "binary");
    public static final DataType     BINARY             = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.BINARY, "binary", "binary");
    public static final DataType     VARBINARY          = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.VARBINARY, "varbinary", "binary");
    public static final DataType       DATE               = new DefaultDataType(SQLDialect.MYSQL, SQLDataType.DATE, "date", "date");
    public static final DataType




© 2015 - 2024 Weber Informatics LLC | Privacy Policy