Package org.hibernate.engine.jdbc
Class Size
- java.lang.Object
-
- org.hibernate.engine.jdbc.Size
-
- All Implemented Interfaces:
Serializable
public class Size extends Object implements Serializable
Models size restrictions/requirements on a column's datatype.- See Also:
- Serialized Form
- Implementation Note:
- Since we do not necessarily know the datatype up front, and therefore do not necessarily know
whether length or precision/scale sizing is needed, we simply account for both here. Additionally, LOB
sizes, by standard, are allowed a "multiplier",
K
(Kb),M
(Mb) orG
(Gb).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Size.LobMultiplier
Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_LENGTH
static long
DEFAULT_LOB_LENGTH
static int
DEFAULT_PRECISION
static int
DEFAULT_SCALE
static long
LONG_LENGTH
-
Constructor Summary
Constructors Constructor Description Size()
Size(Integer precision, Integer scale, Integer length, Size.LobMultiplier lobMultiplier)
Deprecated, for removal: This API element is subject to removal in a future version.in favor ofSize(Integer, Integer, Long)
Size(Integer precision, Integer scale, Long length)
Size(Integer precision, Integer scale, Long length, Size.LobMultiplier lobMultiplier)
Deprecated, for removal: This API element is subject to removal in a future version.in favor ofSize(Integer, Integer, Long)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Integer
getArrayLength()
Long
getLength()
Size.LobMultiplier
getLobMultiplier()
Deprecated, for removal: This API element is subject to removal in a future version.Integer
getPrecision()
Integer
getScale()
void
initialize(Size size)
static Size
length(long length)
static Size
length(long length, Size.LobMultiplier lobMultiplier)
static Size
nil()
static Size
precision(int precision)
static Size
precision(int precision, int scale)
Size
setArrayLength(Integer arrayLength)
Size
setLength(Long length)
Size
setLobMultiplier(Size.LobMultiplier lobMultiplier)
Deprecated, for removal: This API element is subject to removal in a future version.Size
setPrecision(Integer precision)
Size
setScale(Integer scale)
-
-
-
Field Detail
-
DEFAULT_LENGTH
public static final long DEFAULT_LENGTH
- See Also:
- Constant Field Values
-
LONG_LENGTH
public static final long LONG_LENGTH
- See Also:
- Constant Field Values
-
DEFAULT_LOB_LENGTH
public static final long DEFAULT_LOB_LENGTH
- See Also:
- Constant Field Values
-
DEFAULT_PRECISION
public static final int DEFAULT_PRECISION
- See Also:
- Constant Field Values
-
DEFAULT_SCALE
public static final int DEFAULT_SCALE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Size
public Size()
-
Size
@Deprecated(forRemoval=true) public Size(Integer precision, Integer scale, Long length, Size.LobMultiplier lobMultiplier)
Deprecated, for removal: This API element is subject to removal in a future version.in favor ofSize(Integer, Integer, Long)
Complete constructor.- Parameters:
precision
- numeric precisionscale
- numeric scalelength
- type lengthlobMultiplier
- LOB length multiplier
-
Size
@Deprecated(forRemoval=true) public Size(Integer precision, Integer scale, Integer length, Size.LobMultiplier lobMultiplier)
Deprecated, for removal: This API element is subject to removal in a future version.in favor ofSize(Integer, Integer, Long)
-
-
Method Detail
-
nil
public static Size nil()
-
precision
public static Size precision(int precision)
-
precision
public static Size precision(int precision, int scale)
-
length
public static Size length(long length)
-
length
public static Size length(long length, Size.LobMultiplier lobMultiplier)
-
getPrecision
public Integer getPrecision()
-
getScale
public Integer getScale()
-
getLength
public Long getLength()
-
getArrayLength
public Integer getArrayLength()
-
getLobMultiplier
@Deprecated(forRemoval=true) public Size.LobMultiplier getLobMultiplier()
Deprecated, for removal: This API element is subject to removal in a future version.
-
initialize
public void initialize(Size size)
-
setLobMultiplier
@Deprecated(forRemoval=true) public Size setLobMultiplier(Size.LobMultiplier lobMultiplier)
Deprecated, for removal: This API element is subject to removal in a future version.
-
-