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