public Postgres8Platform() { super(); this.dbIdentity.setSupportsGetGeneratedKeys(false); this.dbIdentity.setIdType(IdType.SEQUENCE); this.dbIdentity.setSupportsSequence(true); this.dbIdentity.setSupportsIdentity(true); this.columnAliasPrefix = "as c"; }
public HsqldbPlatform() { super(); this.platform = Platform.HSQLDB; this.dbEncrypt = new H2DbEncrypt(); this.platformDdl = new HsqldbDdl(this); this.dbIdentity.setIdType(IdType.IDENTITY); this.dbIdentity.setSupportsGetGeneratedKeys(true); this.dbIdentity.setSupportsSequence(true); this.dbIdentity.setSupportsIdentity(true); dbTypeMap.put(DbType.INTEGER, new DbPlatformType("integer", false)); }
public H2Platform() { super(); this.platform = Platform.H2; this.dbEncrypt = new H2DbEncrypt(); this.platformDdl = new H2Ddl(this); this.historySupport = new H2HistorySupport(); this.nativeUuidType = true; this.dbDefaultValue.setNow("now()"); this.dbIdentity.setIdType(IdType.IDENTITY); this.dbIdentity.setSupportsGetGeneratedKeys(true); this.dbIdentity.setSupportsSequence(true); this.dbIdentity.setSupportsIdentity(true); // like ? escape'' not working in the latest version H2 so just using no // escape clause for now noting that backslash is an escape char for like in H2 this.likeClause = "like ?"; dbTypeMap.put(DbType.UUID, new DbPlatformType("uuid", false)); }
public H2Platform() { super(); this.name = "h2"; this.dbEncrypt = new H2DbEncrypt(); // only support getGeneratedKeys with non-batch JDBC // so generally use SEQUENCE instead of IDENTITY for H2 boolean useIdentity = GlobalProperties.getBoolean("ebean.h2platform.useIdentity", false); IdType idType = useIdentity ? IdType.IDENTITY : IdType.SEQUENCE; this.dbIdentity.setIdType(idType); this.dbIdentity.setSupportsGetGeneratedKeys(true); this.dbIdentity.setSupportsSequence(true); this.dbIdentity.setSupportsIdentity(true); this.openQuote = "\""; this.closeQuote = "\""; // H2 data types match default JDBC types // so no changes to dbTypeMap required this.dbDdlSyntax.setDropIfExists("if exists"); this.dbDdlSyntax.setDisableReferentialIntegrity("SET REFERENTIAL_INTEGRITY FALSE"); this.dbDdlSyntax.setEnableReferentialIntegrity("SET REFERENTIAL_INTEGRITY TRUE"); this.dbDdlSyntax.setForeignKeySuffix("on delete restrict on update restrict"); }
public H2Platform() { super(); this.name = "h2"; this.dbEncrypt = new H2DbEncrypt(); // only support getGeneratedKeys with non-batch JDBC // so generally use SEQUENCE instead of IDENTITY for H2 boolean useIdentity = GlobalProperties.getBoolean("ebean.h2platform.useIdentity", false); IdType idType = useIdentity ? IdType.IDENTITY : IdType.SEQUENCE; this.dbIdentity.setIdType(idType); this.dbIdentity.setSupportsGetGeneratedKeys(true); this.dbIdentity.setSupportsSequence(true); this.dbIdentity.setSupportsIdentity(true); this.openQuote = "\""; this.closeQuote = "\""; // H2 data types match default JDBC types // so no changes to dbTypeMap required this.dbDdlSyntax.setDropIfExists("if exists"); this.dbDdlSyntax.setDisableReferentialIntegrity("SET REFERENTIAL_INTEGRITY FALSE"); this.dbDdlSyntax.setEnableReferentialIntegrity("SET REFERENTIAL_INTEGRITY TRUE"); this.dbDdlSyntax.setForeignKeySuffix("on delete restrict on update restrict"); }
public HsqldbPlatform(){ super(); this.name = "hsqldb"; this.dbEncrypt = new H2DbEncrypt(); // only support getGeneratedKeys with non-batch JDBC // so generally use SEQUENCE instead of IDENTITY for H2 boolean useIdentity = GlobalProperties.getBoolean("ebean.hsqldb.useIdentity", true); IdType idType = useIdentity ? IdType.IDENTITY : IdType.SEQUENCE; this.dbIdentity.setIdType(idType); this.dbIdentity.setSupportsGetGeneratedKeys(true); this.dbIdentity.setSupportsSequence(true); this.dbIdentity.setSupportsIdentity(true); this.openQuote = "\""; this.closeQuote = "\""; // H2 data types match default JDBC types // so no changes to dbTypeMap required dbTypeMap.put(Types.INTEGER, new DbType("integer",false)); this.dbDdlSyntax.setDropIfExists("if exists"); this.dbDdlSyntax.setDisableReferentialIntegrity("SET DATABASE REFERENTIAL INTEGRITY FALSE"); this.dbDdlSyntax.setEnableReferentialIntegrity("SET DATABASE REFERENTIAL INTEGRITY TRUE"); this.dbDdlSyntax.setForeignKeySuffix("on delete restrict on update restrict"); this.dbDdlSyntax.setIdentity("GENERATED BY DEFAULT AS IDENTITY (START WITH 1) "); }
public HsqldbPlatform() { super(); this.name = "hsqldb"; this.dbEncrypt = new H2DbEncrypt(); // only support getGeneratedKeys with non-batch JDBC // so generally use SEQUENCE instead of IDENTITY for H2 boolean useIdentity = GlobalProperties.getBoolean("ebean.hsqldb.useIdentity", true); IdType idType = useIdentity ? IdType.IDENTITY : IdType.SEQUENCE; this.dbIdentity.setIdType(idType); this.dbIdentity.setSupportsGetGeneratedKeys(true); this.dbIdentity.setSupportsSequence(true); this.dbIdentity.setSupportsIdentity(true); this.openQuote = "\""; this.closeQuote = "\""; // H2 data types match default JDBC types // so no changes to dbTypeMap required dbTypeMap.put(Types.INTEGER, new DbType("integer", false)); this.dbDdlSyntax.setDropIfExists("if exists"); this.dbDdlSyntax.setDisableReferentialIntegrity("SET DATABASE REFERENTIAL INTEGRITY FALSE"); this.dbDdlSyntax.setEnableReferentialIntegrity("SET DATABASE REFERENTIAL INTEGRITY TRUE"); this.dbDdlSyntax.setForeignKeySuffix("on delete restrict on update restrict"); this.dbDdlSyntax.setIdentity("GENERATED BY DEFAULT AS IDENTITY (START WITH 1) "); }
public MySqlPlatform() { super(); this.platform = Platform.MYSQL; this.useExtraTransactionOnIterateSecondaryQueries = true; this.likeClause = "like ? escape''"; this.selectCountWithAlias = true; this.dbEncrypt = new MySqlDbEncrypt(); this.platformDdl = new MySqlDdl(this); this.historySupport = new MySqlHistorySupport(); this.dbIdentity.setIdType(IdType.IDENTITY); this.dbIdentity.setSupportsGetGeneratedKeys(true); this.dbIdentity.setSupportsIdentity(true); this.dbIdentity.setSupportsSequence(false); this.openQuote = "`"; this.closeQuote = "`"; this.forwardOnlyHintOnFindIterate = true; this.booleanDbType = Types.BIT; dbTypeMap.put(DbType.BIT, new DbPlatformType("tinyint(1) default 0")); dbTypeMap.put(DbType.BOOLEAN, new DbPlatformType("tinyint(1) default 0")); dbTypeMap.put(DbType.TIMESTAMP, new DbPlatformType("datetime(6)")); dbTypeMap.put(DbType.CLOB, new MySqlClob()); dbTypeMap.put(DbType.BLOB, new MySqlBlob()); dbTypeMap.put(DbType.BINARY, new DbPlatformType("binary", 255)); dbTypeMap.put(DbType.VARBINARY, new DbPlatformType("varbinary", 255)); }
public SqlAnywherePlatform() { super(); this.platform = Platform.SQLANYWHERE; this.dbIdentity.setIdType(IdType.IDENTITY); this.sqlLimiter = new SqlAnywhereLimiter(); this.dbIdentity.setSupportsGetGeneratedKeys(false); this.dbIdentity.setSelectLastInsertedIdTemplate("select @@IDENTITY as X"); this.dbIdentity.setSupportsIdentity(true); dbTypeMap.put(DbType.BOOLEAN, new DbPlatformType("bit default 0")); dbTypeMap.put(DbType.BIGINT, new DbPlatformType("numeric", 19)); dbTypeMap.put(DbType.REAL, new DbPlatformType("float(16)")); dbTypeMap.put(DbType.DOUBLE, new DbPlatformType("float(32)")); dbTypeMap.put(DbType.TINYINT, new DbPlatformType("smallint")); dbTypeMap.put(DbType.DECIMAL, new DbPlatformType("numeric", 28)); dbTypeMap.put(DbType.BLOB, new DbPlatformType("binary(4500)")); dbTypeMap.put(DbType.CLOB, new DbPlatformType("long varchar")); dbTypeMap.put(DbType.LONGVARBINARY, new DbPlatformType("long binary")); dbTypeMap.put(DbType.LONGVARCHAR, new DbPlatformType("long varchar")); }
public SqlAnywherePlatform() { super(); this.name = "sqlanywhere"; this.dbIdentity.setIdType(IdType.IDENTITY); this.sqlLimiter = new SqlAnywhereLimiter(); this.dbIdentity.setSupportsGetGeneratedKeys(false); this.dbIdentity.setSelectLastInsertedIdTemplate("select @@IDENTITY as X"); this.dbIdentity.setSupportsIdentity(true); dbTypeMap.put(Types.BOOLEAN, new DbType("bit default 0")); dbTypeMap.put(Types.BIGINT, new DbType("numeric", 19)); dbTypeMap.put(Types.REAL, new DbType("float(16)")); dbTypeMap.put(Types.DOUBLE, new DbType("float(32)")); dbTypeMap.put(Types.TINYINT, new DbType("smallint")); dbTypeMap.put(Types.DECIMAL, new DbType("numeric", 28)); dbTypeMap.put(Types.BLOB, new DbType("binary(4500)")); dbTypeMap.put(Types.CLOB, new DbType("long varchar")); dbTypeMap.put(Types.LONGVARBINARY, new DbType("long binary")); dbTypeMap.put(Types.LONGVARCHAR, new DbType("long varchar")); }
public SqlAnywherePlatform() { super(); this.name = "sqlanywhere"; this.dbIdentity.setIdType(IdType.IDENTITY); this.sqlLimiter = new SqlAnywhereLimiter(); this.dbIdentity.setSupportsGetGeneratedKeys(false); this.dbIdentity.setSelectLastInsertedIdTemplate("select @@IDENTITY as X"); this.dbIdentity.setSupportsIdentity(true); dbTypeMap.put(Types.BOOLEAN, new DbType("bit default 0")); dbTypeMap.put(Types.BIGINT, new DbType("numeric", 19)); dbTypeMap.put(Types.REAL, new DbType("float(16)")); dbTypeMap.put(Types.DOUBLE, new DbType("float(32)")); dbTypeMap.put(Types.TINYINT, new DbType("smallint")); dbTypeMap.put(Types.DECIMAL, new DbType("numeric", 28)); dbTypeMap.put(Types.BLOB, new DbType("binary(4500)")); dbTypeMap.put(Types.CLOB, new DbType("long varchar")); dbTypeMap.put(Types.LONGVARBINARY, new DbType("long binary")); dbTypeMap.put(Types.LONGVARCHAR, new DbType("long varchar")); }
public MySqlPlatform(){ super(); this.name = "mysql"; this.selectCountWithAlias = true; this.dbEncrypt = new MySqlDbEncrypt(); this.dbIdentity.setIdType(IdType.IDENTITY); this.dbIdentity.setSupportsGetGeneratedKeys(true); this.dbIdentity.setSupportsIdentity(true); this.dbIdentity.setSupportsSequence(false); this.openQuote = "`"; this.closeQuote = "`"; this.booleanDbType = Types.BIT; dbTypeMap.put(Types.BIT, new DbType("tinyint(1) default 0")); dbTypeMap.put(Types.BOOLEAN, new DbType("tinyint(1) default 0")); dbTypeMap.put(Types.TIMESTAMP, new DbType("datetime")); dbTypeMap.put(Types.CLOB, new MySqlClob()); dbTypeMap.put(Types.BLOB, new MySqlBlob()); dbTypeMap.put(Types.BINARY, new DbType("binary",255)); dbTypeMap.put(Types.VARBINARY, new DbType("varbinary",255)); dbDdlSyntax.setMaxConstraintNameLength(64); dbDdlSyntax.setDisableReferentialIntegrity("SET FOREIGN_KEY_CHECKS=0"); dbDdlSyntax.setEnableReferentialIntegrity("SET FOREIGN_KEY_CHECKS=1"); dbDdlSyntax.setForeignKeySuffix("on delete restrict on update restrict"); }
public MySqlPlatform() { super(); this.name = "mysql"; this.selectCountWithAlias = true; this.dbEncrypt = new MySqlDbEncrypt(); this.dbIdentity.setIdType(IdType.IDENTITY); this.dbIdentity.setSupportsGetGeneratedKeys(true); this.dbIdentity.setSupportsIdentity(true); this.dbIdentity.setSupportsSequence(false); this.openQuote = "`"; this.closeQuote = "`"; this.booleanDbType = Types.BIT; dbTypeMap.put(Types.BIT, new DbType("tinyint(1) default 0")); dbTypeMap.put(Types.BOOLEAN, new DbType("tinyint(1) default 0")); dbTypeMap.put(Types.TIMESTAMP, new DbType("datetime")); dbTypeMap.put(Types.CLOB, new MySqlClob()); dbTypeMap.put(Types.BLOB, new MySqlBlob()); dbTypeMap.put(Types.BINARY, new DbType("binary", 255)); dbTypeMap.put(Types.VARBINARY, new DbType("varbinary", 255)); dbDdlSyntax.setMaxConstraintNameLength(64); dbDdlSyntax.setDisableReferentialIntegrity("SET FOREIGN_KEY_CHECKS=0"); dbDdlSyntax.setEnableReferentialIntegrity("SET FOREIGN_KEY_CHECKS=1"); dbDdlSyntax.setForeignKeySuffix("on delete restrict on update restrict"); }
public MsSqlServer2000Platform(){ super(); this.name = "mssqlserver2000"; this.dbIdentity.setIdType(IdType.IDENTITY); this.dbIdentity.setSupportsGetGeneratedKeys(false); this.dbIdentity.setSelectLastInsertedIdTemplate("select @@IDENTITY as X"); this.dbIdentity.setSupportsIdentity(true); this.openQuote = "["; this.closeQuote = "]"; dbTypeMap.put(Types.BOOLEAN, new DbType("bit default 0")); dbTypeMap.put(Types.BIGINT, new DbType("numeric", 19)); dbTypeMap.put(Types.REAL, new DbType("float(16)")); dbTypeMap.put(Types.DOUBLE, new DbType("float(32)")); dbTypeMap.put(Types.TINYINT, new DbType("smallint")); dbTypeMap.put(Types.DECIMAL, new DbType("numeric", 28)); dbTypeMap.put(Types.BLOB, new DbType("image")); dbTypeMap.put(Types.CLOB, new DbType("text")); dbTypeMap.put(Types.LONGVARBINARY, new DbType("image")); dbTypeMap.put(Types.LONGVARCHAR, new DbType("text")); dbTypeMap.put(Types.DATE, new DbType("datetime")); dbTypeMap.put(Types.TIME, new DbType("datetime")); dbTypeMap.put(Types.TIMESTAMP, new DbType("datetime")); }
public MsSqlServer2000Platform() { super(); this.name = "mssqlserver2000"; this.dbIdentity.setIdType(IdType.IDENTITY); this.dbIdentity.setSupportsGetGeneratedKeys(false); this.dbIdentity.setSelectLastInsertedIdTemplate("select @@IDENTITY as X"); this.dbIdentity.setSupportsIdentity(true); this.openQuote = "["; this.closeQuote = "]"; dbTypeMap.put(Types.BOOLEAN, new DbType("bit default 0")); dbTypeMap.put(Types.BIGINT, new DbType("numeric", 19)); dbTypeMap.put(Types.REAL, new DbType("float(16)")); dbTypeMap.put(Types.DOUBLE, new DbType("float(32)")); dbTypeMap.put(Types.TINYINT, new DbType("smallint")); dbTypeMap.put(Types.DECIMAL, new DbType("numeric", 28)); dbTypeMap.put(Types.BLOB, new DbType("image")); dbTypeMap.put(Types.CLOB, new DbType("text")); dbTypeMap.put(Types.LONGVARBINARY, new DbType("image")); dbTypeMap.put(Types.LONGVARCHAR, new DbType("text")); dbTypeMap.put(Types.DATE, new DbType("datetime")); dbTypeMap.put(Types.TIME, new DbType("datetime")); dbTypeMap.put(Types.TIMESTAMP, new DbType("datetime")); }
public MsSqlServer2005Platform(){ super(); this.name = "mssqlserver2005"; this.sqlLimiter = new MsSqlServer2005SqlLimiter(); this.dbDdlSyntax.setIdentity("identity(1,1)"); this.dbIdentity.setIdType(IdType.IDENTITY); this.dbIdentity.setSupportsGetGeneratedKeys(true); this.dbIdentity.setSupportsIdentity(true); this.openQuote = "["; this.closeQuote = "]"; dbTypeMap.put(Types.BOOLEAN, new DbType("bit default 0")); dbTypeMap.put(Types.BIGINT, new DbType("numeric", 19)); dbTypeMap.put(Types.REAL, new DbType("float(16)")); dbTypeMap.put(Types.DOUBLE, new DbType("float(32)")); dbTypeMap.put(Types.TINYINT, new DbType("smallint")); dbTypeMap.put(Types.DECIMAL, new DbType("numeric", 28)); dbTypeMap.put(Types.BLOB, new DbType("image")); dbTypeMap.put(Types.CLOB, new DbType("text")); dbTypeMap.put(Types.LONGVARBINARY, new DbType("image")); dbTypeMap.put(Types.LONGVARCHAR, new DbType("text")); dbTypeMap.put(Types.DATE, new DbType("datetime")); dbTypeMap.put(Types.TIME, new DbType("datetime")); dbTypeMap.put(Types.TIMESTAMP, new DbType("datetime")); }
public MsSqlServer2005Platform() { super(); this.name = "mssqlserver2005"; this.sqlLimiter = new MsSqlServer2005SqlLimiter(); this.dbDdlSyntax.setIdentity("identity(1,1)"); this.dbIdentity.setIdType(IdType.IDENTITY); this.dbIdentity.setSupportsGetGeneratedKeys(true); this.dbIdentity.setSupportsIdentity(true); this.openQuote = "["; this.closeQuote = "]"; dbTypeMap.put(Types.BOOLEAN, new DbType("bit default 0")); dbTypeMap.put(Types.BIGINT, new DbType("numeric", 19)); dbTypeMap.put(Types.REAL, new DbType("float(16)")); dbTypeMap.put(Types.DOUBLE, new DbType("float(32)")); dbTypeMap.put(Types.TINYINT, new DbType("smallint")); dbTypeMap.put(Types.DECIMAL, new DbType("numeric", 28)); dbTypeMap.put(Types.BLOB, new DbType("image")); dbTypeMap.put(Types.CLOB, new DbType("text")); dbTypeMap.put(Types.LONGVARBINARY, new DbType("image")); dbTypeMap.put(Types.LONGVARCHAR, new DbType("text")); dbTypeMap.put(Types.DATE, new DbType("datetime")); dbTypeMap.put(Types.TIME, new DbType("datetime")); dbTypeMap.put(Types.TIMESTAMP, new DbType("datetime")); }
this.dbIdentity.setIdType(IdType.IDENTITY); this.dbIdentity.setSupportsGetGeneratedKeys(true); this.dbIdentity.setSupportsIdentity(true);