mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-16 16:15:06 +00:00
make use of Length constants in Dialects instead of Integer.MAX_VALUE
Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
parent
d4593b00ce
commit
93ec580fad
@ -19,6 +19,7 @@
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.hibernate.Length;
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.LockOptions;
|
||||
import org.hibernate.PessimisticLockException;
|
||||
@ -280,7 +281,7 @@ public int getMaxVarcharCapacity() {
|
||||
@Override
|
||||
public int getMaxVarbinaryLength() {
|
||||
//postgres has no varbinary-like type
|
||||
return Integer.MAX_VALUE;
|
||||
return Length.LONG32;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -289,7 +289,7 @@ public long getDefaultLobLength() {
|
||||
// this is essentially the only legal length for
|
||||
// a "lob" in SQL Server, i.e. the value of MAX
|
||||
// (caveat: for NVARCHAR it is half this value)
|
||||
return Integer.MAX_VALUE;
|
||||
return Length.LONG32;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.hibernate.Length;
|
||||
import org.hibernate.LockOptions;
|
||||
import org.hibernate.boot.model.FunctionContributions;
|
||||
import org.hibernate.community.dialect.identity.SybaseAnywhereIdentityColumnSupport;
|
||||
@ -103,7 +104,7 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
|
||||
|
||||
@Override
|
||||
public int getMaxVarcharLength() {
|
||||
return 32_767;
|
||||
return Length.LONG16;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4760,7 +4760,7 @@ public SizeStrategy getSizeStrategy() {
|
||||
*/
|
||||
public int getMaxVarcharLength() {
|
||||
//the longest possible length of a Java string
|
||||
return Integer.MAX_VALUE;
|
||||
return Length.LONG32;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,7 @@
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.hibernate.Length;
|
||||
import org.hibernate.LockOptions;
|
||||
import org.hibernate.PessimisticLockException;
|
||||
import org.hibernate.boot.model.FunctionContributions;
|
||||
@ -534,7 +535,7 @@ public SizeStrategy getSizeStrategy() {
|
||||
|
||||
@Override
|
||||
public long getDefaultLobLength() {
|
||||
return Integer.MAX_VALUE;
|
||||
return Length.LONG32;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,6 +17,7 @@
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.hibernate.Length;
|
||||
import org.hibernate.QueryTimeoutException;
|
||||
import org.hibernate.boot.model.FunctionContributions;
|
||||
import org.hibernate.boot.model.TypeContributions;
|
||||
@ -390,13 +391,13 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
|
||||
@Override
|
||||
public int getMaxVarcharLength() {
|
||||
//with MAX_STRING_SIZE=EXTENDED, changes to 32_767
|
||||
return extended ? 32_767 : 4000;
|
||||
return extended ? Length.LONG16 : 4000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxVarbinaryLength() {
|
||||
//with MAX_STRING_SIZE=EXTENDED, changes to 32_767
|
||||
return extended ? 32_767 : 2000;
|
||||
return extended ? Length.LONG16 : 2000;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.hibernate.Length;
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.LockOptions;
|
||||
import org.hibernate.PessimisticLockException;
|
||||
@ -298,7 +299,7 @@ public int getMaxVarcharCapacity() {
|
||||
@Override
|
||||
public int getMaxVarbinaryLength() {
|
||||
//postgres has no varbinary-like type
|
||||
return Integer.MAX_VALUE;
|
||||
return Length.LONG32;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.hibernate.Length;
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.LockOptions;
|
||||
import org.hibernate.QueryTimeoutException;
|
||||
@ -298,7 +299,7 @@ public long getDefaultLobLength() {
|
||||
// this is essentially the only legal length for
|
||||
// a "lob" in SQL Server, i.e. the value of MAX
|
||||
// (caveat: for NVARCHAR it is half this value)
|
||||
return Integer.MAX_VALUE;
|
||||
return Length.LONG32;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,6 +11,7 @@
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Types;
|
||||
|
||||
import org.hibernate.Length;
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.LockOptions;
|
||||
import org.hibernate.QueryTimeoutException;
|
||||
@ -176,7 +177,7 @@ public int getMaxVarcharLength() {
|
||||
|
||||
@Override
|
||||
public long getDefaultLobLength() {
|
||||
return Integer.MAX_VALUE;
|
||||
return Length.LONG32;
|
||||
}
|
||||
|
||||
private static boolean isAnsiNull(DialectResolutionInfo info) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user