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) "); }