Skip to content

Commit

Permalink
Fix for Blazebit#1870 Override MSSQLDbmsDialect to use varchar(max) f…
Browse files Browse the repository at this point in the history
…or String instead of varchar(30)
  • Loading branch information
Aniket-Singla authored and beikov committed Feb 19, 2024
1 parent e324501 commit 184bf79
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.blazebit.persistence.spi.SetOperationType;
import com.blazebit.persistence.spi.UpdateJoinStyle;

import java.util.HashMap;
import java.util.Map;

/**
Expand All @@ -37,12 +38,22 @@
public class MSSQLDbmsDialect extends DefaultDbmsDialect {

public MSSQLDbmsDialect() {
super(getSqlTypes());
}

public MSSQLDbmsDialect(Map<Class<?>, String> childSqlTypes) {
super(childSqlTypes);
}

protected static Map<Class<?>, String> getSqlTypes() {
Map<Class<?>, String> types = new HashMap<>();

// SQL Server default varchar length is 30. We are overriding the same to make it good fit for String
types.put(String.class, "varchar(max)");

return types;
}

@Override
public String getWithClause(boolean recursive) {
return "with";
Expand Down

0 comments on commit 184bf79

Please sign in to comment.