001package com.avaje.ebean.config.dbplatform; 002 003import com.avaje.ebean.BackgroundExecutor; 004import com.avaje.ebean.dbmigration.ddlgeneration.platform.HsqldbDdl; 005 006import javax.sql.DataSource; 007import java.sql.Types; 008 009/** 010 * H2 specific platform. 011 */ 012public class HsqldbPlatform extends DatabasePlatform { 013 014 public HsqldbPlatform() { 015 super(); 016 this.name = "hsqldb"; 017 this.dbEncrypt = new H2DbEncrypt(); 018 this.platformDdl = new HsqldbDdl(this); 019 020 this.dbIdentity.setIdType(IdType.IDENTITY); 021 this.dbIdentity.setSupportsGetGeneratedKeys(true); 022 this.dbIdentity.setSupportsSequence(true); 023 this.dbIdentity.setSupportsIdentity(true); 024 025 dbTypeMap.put(Types.INTEGER, new DbType("integer", false)); 026 } 027 028 @Override 029 public PlatformIdGenerator createSequenceIdGenerator(BackgroundExecutor be, DataSource ds, String seqName, int batchSize) { 030 031 return new H2SequenceIdGenerator(be, ds, seqName, batchSize); 032 } 033 034}