001package com.avaje.ebean.config.dbplatform;
002
003import java.sql.Types;
004
005/**
006 * Microsoft SQL Server 2000 specific platform.
007 * <p>
008 * <ul>
009 * <li>supportsGetGeneratedKeys = false</li>
010 * <li>Use select @@IDENTITY to return the generated Id instead</li>
011 * <li>Uses LIMIT OFFSET clause</li>
012 * <li>Uses [ & ] for quoted identifiers</li>
013 * </ul>
014 * </p>
015 */
016public class MsSqlServer2000Platform extends DatabasePlatform {
017
018  public MsSqlServer2000Platform() {
019    super();
020    this.name = "mssqlserver2000";
021    this.dbIdentity.setIdType(IdType.IDENTITY);
022    this.dbIdentity.setSupportsGetGeneratedKeys(false);
023    this.dbIdentity.setSelectLastInsertedIdTemplate("select @@IDENTITY as X");
024    this.dbIdentity.setSupportsIdentity(true);
025
026    this.openQuote = "[";
027    this.closeQuote = "]";
028
029    dbTypeMap.put(Types.BOOLEAN, new DbType("bit default 0"));
030
031    dbTypeMap.put(Types.BIGINT, new DbType("numeric", 19));
032    dbTypeMap.put(Types.REAL, new DbType("float(16)"));
033    dbTypeMap.put(Types.DOUBLE, new DbType("float(32)"));
034    dbTypeMap.put(Types.TINYINT, new DbType("smallint"));
035    dbTypeMap.put(Types.DECIMAL, new DbType("numeric", 28));
036
037    dbTypeMap.put(Types.BLOB, new DbType("image"));
038    dbTypeMap.put(Types.CLOB, new DbType("text"));
039    dbTypeMap.put(Types.LONGVARBINARY, new DbType("image"));
040    dbTypeMap.put(Types.LONGVARCHAR, new DbType("text"));
041
042    dbTypeMap.put(Types.DATE, new DbType("datetime"));
043    dbTypeMap.put(Types.TIME, new DbType("datetime"));
044    dbTypeMap.put(Types.TIMESTAMP, new DbType("datetime"));
045
046  }
047
048}