001package io.ebean.config.dbplatform.sqlanywhere;
002
003import io.ebean.annotation.Platform;
004import io.ebean.config.dbplatform.DatabasePlatform;
005import io.ebean.config.dbplatform.DbPlatformType;
006import io.ebean.config.dbplatform.DbType;
007import io.ebean.config.dbplatform.IdType;
008
009/**
010 * Sybase SQL Anywhere specific platform.
011 * <p>
012 * <ul>
013 * <li>supportsGetGeneratedKeys = false</li>
014 * <li>Uses TOP START AT clause</li>
015 * </ul>
016 * </p>
017 */
018public class SqlAnywherePlatform extends DatabasePlatform {
019
020  public SqlAnywherePlatform() {
021    super();
022    this.platform = Platform.SQLANYWHERE;
023    this.dbIdentity.setIdType(IdType.IDENTITY);
024
025    this.sqlLimiter = new SqlAnywhereLimiter();
026    this.dbIdentity.setSupportsGetGeneratedKeys(false);
027    this.dbIdentity.setSelectLastInsertedIdTemplate("select @@IDENTITY as X");
028    this.dbIdentity.setSupportsIdentity(true);
029
030    dbTypeMap.put(DbType.BOOLEAN, new DbPlatformType("bit"));
031    dbTypeMap.put(DbType.BIGINT, new DbPlatformType("numeric", 19));
032    dbTypeMap.put(DbType.REAL, new DbPlatformType("float(16)"));
033    dbTypeMap.put(DbType.DOUBLE, new DbPlatformType("float(32)"));
034    dbTypeMap.put(DbType.TINYINT, new DbPlatformType("smallint"));
035    dbTypeMap.put(DbType.DECIMAL, new DbPlatformType("numeric", 16, 3));
036    dbTypeMap.put(DbType.BLOB, new DbPlatformType("binary(4500)"));
037    dbTypeMap.put(DbType.CLOB, new DbPlatformType("long varchar"));
038    dbTypeMap.put(DbType.LONGVARBINARY, new DbPlatformType("long binary"));
039    dbTypeMap.put(DbType.LONGVARCHAR, new DbPlatformType("long varchar"));
040
041  }
042
043}