[#2391] Rename dialect-specific Factories [Dialect]Factory to
[Dialect]DSL
This commit is contained in:
parent
078da8a28b
commit
28073c01db
@ -47,18 +47,18 @@ import static org.jooq.test.mysql.generatedclasses.Tables.T_IDENTITY_PK;
|
||||
import static org.jooq.test.mysql.generatedclasses.Tables.T_UNSIGNED;
|
||||
import static org.jooq.test.mysql.generatedclasses.Tables.V_AUTHOR;
|
||||
import static org.jooq.test.mysql.generatedclasses.Tables.V_BOOK;
|
||||
import static org.jooq.util.mysql.MySQLFactory.aesDecrypt;
|
||||
import static org.jooq.util.mysql.MySQLFactory.aesEncrypt;
|
||||
import static org.jooq.util.mysql.MySQLFactory.compress;
|
||||
import static org.jooq.util.mysql.MySQLFactory.decode;
|
||||
import static org.jooq.util.mysql.MySQLFactory.desDecrypt;
|
||||
import static org.jooq.util.mysql.MySQLFactory.desEncrypt;
|
||||
import static org.jooq.util.mysql.MySQLFactory.encode;
|
||||
import static org.jooq.util.mysql.MySQLFactory.password;
|
||||
import static org.jooq.util.mysql.MySQLFactory.sha1;
|
||||
import static org.jooq.util.mysql.MySQLFactory.sha2;
|
||||
import static org.jooq.util.mysql.MySQLFactory.uncompress;
|
||||
import static org.jooq.util.mysql.MySQLFactory.uncompressedLength;
|
||||
import static org.jooq.util.mysql.MySQLDSL.aesDecrypt;
|
||||
import static org.jooq.util.mysql.MySQLDSL.aesEncrypt;
|
||||
import static org.jooq.util.mysql.MySQLDSL.compress;
|
||||
import static org.jooq.util.mysql.MySQLDSL.decode;
|
||||
import static org.jooq.util.mysql.MySQLDSL.desDecrypt;
|
||||
import static org.jooq.util.mysql.MySQLDSL.desEncrypt;
|
||||
import static org.jooq.util.mysql.MySQLDSL.encode;
|
||||
import static org.jooq.util.mysql.MySQLDSL.password;
|
||||
import static org.jooq.util.mysql.MySQLDSL.sha1;
|
||||
import static org.jooq.util.mysql.MySQLDSL.sha2;
|
||||
import static org.jooq.util.mysql.MySQLDSL.uncompress;
|
||||
import static org.jooq.util.mysql.MySQLDSL.uncompressedLength;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
@ -128,7 +128,7 @@ import org.jooq.types.UInteger;
|
||||
import org.jooq.types.ULong;
|
||||
import org.jooq.types.UShort;
|
||||
import org.jooq.util.mysql.MySQLDataType;
|
||||
import org.jooq.util.mysql.MySQLFactory;
|
||||
import org.jooq.util.mysql.MySQLDSL;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
@ -843,11 +843,11 @@ public class MySQLTest extends jOOQAbstractTest<
|
||||
|
||||
@Test
|
||||
public void testMySQLEnumIndex() throws Exception {
|
||||
assertNull(MySQLFactory.enumType(TBookStatus.class, -1));
|
||||
assertNull(MySQLFactory.enumType(TBookStatus.class, 0));
|
||||
assertEquals(TBookStatus.SOLD_OUT, MySQLFactory.enumType(TBookStatus.class, 1));
|
||||
assertEquals(TBookStatus.ORDERED, MySQLFactory.enumType(TBookStatus.class, 2));
|
||||
assertEquals(TBookStatus.ON_STOCK, MySQLFactory.enumType(TBookStatus.class, 3));
|
||||
assertNull(MySQLFactory.enumType(TBookStatus.class, 4));
|
||||
assertNull(MySQLDSL.enumType(TBookStatus.class, -1));
|
||||
assertNull(MySQLDSL.enumType(TBookStatus.class, 0));
|
||||
assertEquals(TBookStatus.SOLD_OUT, MySQLDSL.enumType(TBookStatus.class, 1));
|
||||
assertEquals(TBookStatus.ORDERED, MySQLDSL.enumType(TBookStatus.class, 2));
|
||||
assertEquals(TBookStatus.ON_STOCK, MySQLDSL.enumType(TBookStatus.class, 3));
|
||||
assertNull(MySQLDSL.enumType(TBookStatus.class, 4));
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,9 +78,9 @@ import static org.jooq.test.oracle.generatedclasses.test.udt.UAuthorType.load;
|
||||
import static org.jooq.test.oracle2.generatedclasses.Tables.DATE_AS_TIMESTAMP_T_976;
|
||||
import static org.jooq.test.oracle2.generatedclasses.udt.DateAsTimestampT_976ObjectType.DATE_AS_TIMESTAMP_T_976_OBJECT_TYPE;
|
||||
import static org.jooq.test.oracle3.generatedclasses.DefaultSchema.DEFAULT_SCHEMA;
|
||||
import static org.jooq.util.oracle.OracleFactory.contains;
|
||||
import static org.jooq.util.oracle.OracleFactory.score;
|
||||
import static org.jooq.util.oracle.OracleFactory.sysContext;
|
||||
import static org.jooq.util.oracle.OracleDSL.contains;
|
||||
import static org.jooq.util.oracle.OracleDSL.score;
|
||||
import static org.jooq.util.oracle.OracleDSL.sysContext;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
|
||||
@ -58,7 +58,7 @@ import static org.jooq.impl.DSL.table;
|
||||
import static org.jooq.impl.DSL.trueCondition;
|
||||
import static org.jooq.impl.DSL.two;
|
||||
import static org.jooq.impl.DSL.val;
|
||||
import static org.jooq.util.oracle.OracleFactory.rownum;
|
||||
import static org.jooq.util.oracle.OracleDSL.rownum;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.Arrays;
|
||||
|
||||
@ -58,7 +58,7 @@ import java.util.Map;
|
||||
import org.jooq.conf.Settings;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.types.Interval;
|
||||
import org.jooq.util.oracle.OracleFactory;
|
||||
import org.jooq.util.oracle.OracleDSL;
|
||||
|
||||
/**
|
||||
* A field used in tables and conditions
|
||||
@ -1002,7 +1002,7 @@ public interface Field<T> extends GroupField {
|
||||
* </pre></code>
|
||||
* <p>
|
||||
* Note, this does not correspond to the Oracle Text <code>CONTAINS()</code>
|
||||
* function. Refer to {@link OracleFactory#contains(Field, String)} instead.
|
||||
* function. Refer to {@link OracleDSL#contains(Field, String)} instead.
|
||||
*
|
||||
* @see DSL#escape(String, char)
|
||||
* @see #like(String, char)
|
||||
@ -1029,7 +1029,7 @@ public interface Field<T> extends GroupField {
|
||||
* </pre></code>
|
||||
* <p>
|
||||
* Note, this does not correspond to the Oracle Text <code>CONTAINS()</code>
|
||||
* function. Refer to {@link OracleFactory#contains(Field, String)} instead.
|
||||
* function. Refer to {@link OracleDSL#contains(Field, String)} instead.
|
||||
*
|
||||
* @see DSL#escape(Field, char)
|
||||
* @see #like(Field, char)
|
||||
|
||||
@ -36,22 +36,6 @@
|
||||
|
||||
package org.jooq;
|
||||
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.util.ase.ASEFactory;
|
||||
import org.jooq.util.cubrid.CUBRIDFactory;
|
||||
import org.jooq.util.db2.DB2Factory;
|
||||
import org.jooq.util.derby.DerbyFactory;
|
||||
import org.jooq.util.firebird.FirebirdFactory;
|
||||
import org.jooq.util.h2.H2Factory;
|
||||
import org.jooq.util.hsqldb.HSQLDBFactory;
|
||||
import org.jooq.util.ingres.IngresFactory;
|
||||
import org.jooq.util.mysql.MySQLFactory;
|
||||
import org.jooq.util.oracle.OracleFactory;
|
||||
import org.jooq.util.postgres.PostgresFactory;
|
||||
import org.jooq.util.sqlite.SQLiteFactory;
|
||||
import org.jooq.util.sqlserver.SQLServerFactory;
|
||||
import org.jooq.util.sybase.SybaseFactory;
|
||||
|
||||
/**
|
||||
* This enumeration lists all supported dialects.
|
||||
*
|
||||
@ -66,84 +50,82 @@ public enum SQLDialect {
|
||||
* unit testing
|
||||
*/
|
||||
@Deprecated
|
||||
SQL99(null, null),
|
||||
SQL99(null),
|
||||
|
||||
/**
|
||||
* The Sybase Adaptive Server SQL dialect
|
||||
*/
|
||||
ASE("ASE", ASEFactory.class),
|
||||
ASE("ASE"),
|
||||
|
||||
/**
|
||||
* The CUBRID SQL dialect
|
||||
*/
|
||||
CUBRID("CUBRID", CUBRIDFactory.class),
|
||||
CUBRID("CUBRID"),
|
||||
|
||||
/**
|
||||
* The IBM DB2 SQL dialect
|
||||
*/
|
||||
DB2("DB2", DB2Factory.class),
|
||||
DB2("DB2"),
|
||||
|
||||
/**
|
||||
* The Apache Derby SQL dialect
|
||||
*/
|
||||
DERBY("Derby", DerbyFactory.class),
|
||||
DERBY("Derby"),
|
||||
|
||||
/**
|
||||
* The Firebird SQL dialect
|
||||
*/
|
||||
FIREBIRD("Firebird", FirebirdFactory.class),
|
||||
FIREBIRD("Firebird"),
|
||||
|
||||
/**
|
||||
* The H2 SQL dialect
|
||||
*/
|
||||
H2("H2", H2Factory.class),
|
||||
H2("H2"),
|
||||
|
||||
/**
|
||||
* The Hypersonic SQL dialect
|
||||
*/
|
||||
HSQLDB("HSQLDB", HSQLDBFactory.class),
|
||||
HSQLDB("HSQLDB"),
|
||||
|
||||
/**
|
||||
* The Ingres dialect
|
||||
*/
|
||||
INGRES("Ingres", IngresFactory.class),
|
||||
INGRES("Ingres"),
|
||||
|
||||
/**
|
||||
* The MySQL dialect
|
||||
*/
|
||||
MYSQL("MySQL", MySQLFactory.class),
|
||||
MYSQL("MySQL"),
|
||||
|
||||
/**
|
||||
* The Oracle dialect
|
||||
*/
|
||||
ORACLE("Oracle", OracleFactory.class),
|
||||
ORACLE("Oracle"),
|
||||
|
||||
/**
|
||||
* The PostGres dialect
|
||||
*/
|
||||
POSTGRES("Postgres", PostgresFactory.class),
|
||||
POSTGRES("Postgres"),
|
||||
|
||||
/**
|
||||
* The SQLite dialect
|
||||
*/
|
||||
SQLITE("SQLite", SQLiteFactory.class),
|
||||
SQLITE("SQLite"),
|
||||
|
||||
/**
|
||||
* The SQL Server dialect
|
||||
*/
|
||||
SQLSERVER("SQLServer", SQLServerFactory.class),
|
||||
SQLSERVER("SQLServer"),
|
||||
|
||||
/**
|
||||
* The Sybase dialect
|
||||
*/
|
||||
SYBASE("Sybase", SybaseFactory.class);
|
||||
SYBASE("Sybase");
|
||||
|
||||
private final String name;
|
||||
private final Class<? extends DSL> sQL;
|
||||
private final String name;
|
||||
|
||||
private SQLDialect(String name, Class<? extends DSL> sQL) {
|
||||
private SQLDialect(String name) {
|
||||
this.name = name;
|
||||
this.sQL = sQL;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -166,12 +148,4 @@ public enum SQLDialect {
|
||||
public final String getNameUC() {
|
||||
return name.toUpperCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* A {@link DSLContext} class whose instances are pre-configured with this
|
||||
* dialect.
|
||||
*/
|
||||
public final Class<? extends DSL> getFactory() {
|
||||
return sQL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Utils.fieldArray;
|
||||
import static org.jooq.util.sqlite.SQLiteFactory.rowid;
|
||||
import static org.jooq.util.sqlite.SQLiteDSL.rowid;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
|
||||
@ -34,15 +34,15 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#ASE} specific factory
|
||||
* The {@link SQLDialect#ASE} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class ASEFactory extends DSL {
|
||||
public class ASEDSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private ASEFactory() {
|
||||
private ASEDSL() {
|
||||
}
|
||||
}
|
||||
@ -35,16 +35,16 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#CUBRID} specific factory
|
||||
* The {@link SQLDialect#CUBRID} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class CUBRIDFactory extends DSL {
|
||||
public class CUBRIDDSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private CUBRIDFactory() {
|
||||
private CUBRIDDSL() {
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@ -39,15 +39,15 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#DB2} specific factory
|
||||
* The {@link SQLDialect#DB2} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class DB2Factory extends DSL {
|
||||
public class DB2DSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private DB2Factory() {
|
||||
private DB2DSL() {
|
||||
}
|
||||
}
|
||||
@ -39,15 +39,15 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#DERBY} specific factory
|
||||
* The {@link SQLDialect#DERBY} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class DerbyFactory extends DSL {
|
||||
public class DerbyDSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private DerbyFactory() {
|
||||
private DerbyDSL() {
|
||||
}
|
||||
}
|
||||
@ -39,15 +39,15 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#FIREBIRD} specific factory
|
||||
* The {@link SQLDialect#FIREBIRD} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class FirebirdFactory extends DSL {
|
||||
public class FirebirdDSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private FirebirdFactory() {
|
||||
private FirebirdDSL() {
|
||||
}
|
||||
}
|
||||
@ -39,15 +39,15 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#H2} specific factory
|
||||
* The {@link SQLDialect#H2} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class H2Factory extends DSL {
|
||||
public class H2DSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private H2Factory() {
|
||||
private H2DSL() {
|
||||
}
|
||||
}
|
||||
@ -39,15 +39,15 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#HSQLDB} specific factory
|
||||
* The {@link SQLDialect#HSQLDB} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class HSQLDBFactory extends DSL {
|
||||
public class HSQLDBDSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private HSQLDBFactory() {
|
||||
private HSQLDBDSL() {
|
||||
}
|
||||
}
|
||||
@ -39,15 +39,15 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#INGRES} specific factory
|
||||
* The {@link SQLDialect#INGRES} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class IngresFactory extends DSL {
|
||||
public class IngresDSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private IngresFactory() {
|
||||
private IngresDSL() {
|
||||
}
|
||||
}
|
||||
@ -41,16 +41,16 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#MYSQL} specific factory
|
||||
* The {@link SQLDialect#MYSQL} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class MySQLFactory extends DSL {
|
||||
public class MySQLDSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private MySQLFactory() {
|
||||
private MySQLDSL() {
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@ -46,16 +46,16 @@ import org.jooq.impl.DSL;
|
||||
import org.jooq.impl.SQLDataType;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#ORACLE} specific factory
|
||||
* The {@link SQLDialect#ORACLE} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class OracleFactory extends DSL {
|
||||
public class OracleDSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private OracleFactory() {
|
||||
private OracleDSL() {
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@ -39,15 +39,15 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#POSTGRES} specific factory
|
||||
* The {@link SQLDialect#POSTGRES} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class PostgresFactory extends DSL {
|
||||
public class PostgresDSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private PostgresFactory() {
|
||||
private PostgresDSL() {
|
||||
}
|
||||
}
|
||||
@ -40,16 +40,16 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#SQLITE} specific factory
|
||||
* The {@link SQLDialect#SQLITE} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class SQLiteFactory extends DSL {
|
||||
public class SQLiteDSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private SQLiteFactory() {
|
||||
private SQLiteDSL() {
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@ -39,15 +39,15 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#SQLSERVER} specific factory
|
||||
* The {@link SQLDialect#SQLSERVER} specific DSL.
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public class SQLServerFactory extends DSL {
|
||||
public class SQLServerDSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private SQLServerFactory() {
|
||||
private SQLServerDSL() {
|
||||
}
|
||||
}
|
||||
@ -34,15 +34,15 @@ import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
/**
|
||||
* A {@link SQLDialect#SYBASE} specific factory
|
||||
* The {@link SQLDialect#SYBASE} specific DSL.
|
||||
*
|
||||
* @author Espen Stromsnes
|
||||
*/
|
||||
public class SybaseFactory extends DSL {
|
||||
public class SybaseDSL extends DSL {
|
||||
|
||||
/**
|
||||
* No instances
|
||||
*/
|
||||
private SybaseFactory() {
|
||||
private SybaseDSL() {
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user