#2998 - SQLServer, map java long to BIGINT for bitwise expressions

This commit is contained in:
Rob Bygrave
2023-03-17 17:54:25 +13:00
parent 142ffe925c
commit 04e935acd0
2 changed files with 2 additions and 10 deletions
@@ -2,7 +2,6 @@ package org.tests.expression.bitwise;
import io.ebean.Model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Version;
@@ -15,8 +14,6 @@ public class BwBean extends Model {
String name;
// sqlserver wants integer type for bitwise AND operator
@Column(columnDefinition = "integer")
long flags;
@Version
@@ -5,12 +5,7 @@ import io.ebean.Query;
import io.ebean.annotation.PersistBatch;
import io.ebean.annotation.Platform;
import io.ebean.config.PlatformConfig;
import io.ebean.config.dbplatform.DatabasePlatform;
import io.ebean.config.dbplatform.DbPlatformType;
import io.ebean.config.dbplatform.DbType;
import io.ebean.config.dbplatform.IdType;
import io.ebean.config.dbplatform.PlatformIdGenerator;
import io.ebean.config.dbplatform.SqlErrorCodes;
import io.ebean.config.dbplatform.*;
import javax.sql.DataSource;
import java.sql.Types;
@@ -59,7 +54,7 @@ abstract class SqlServerBasePlatform extends DatabasePlatform {
this.dbDefaultValue.setNow("SYSUTCDATETIME()");
dbTypeMap.put(DbType.BOOLEAN, new DbPlatformType("bit"));
dbTypeMap.put(DbType.INTEGER, new DbPlatformType("integer", false));
dbTypeMap.put(DbType.BIGINT, new DbPlatformType("numeric", 19));
dbTypeMap.put(DbType.BIGINT, new DbPlatformType("bigint", false));
dbTypeMap.put(DbType.REAL, new DbPlatformType("float(16)"));
dbTypeMap.put(DbType.DOUBLE, new DbPlatformType("float(32)"));
dbTypeMap.put(DbType.TINYINT, new DbPlatformType("smallint"));