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
-
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
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Long
getLength()
Size.LobMultiplier
getLobMultiplier()
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
setLength(Long length)
Size
setLobMultiplier(Size.LobMultiplier lobMultiplier)
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
public Size(Integer precision, Integer scale, Long length, Size.LobMultiplier lobMultiplier)
Complete constructor.- Parameters:
precision
- numeric precisionscale
- numeric scalelength
- type lengthlobMultiplier
- LOB length multiplier
-
Size
public Size(Integer precision, Integer scale, Integer length, Size.LobMultiplier lobMultiplier)
-
-
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()
-
getLobMultiplier
public Size.LobMultiplier getLobMultiplier()
-
initialize
public void initialize(Size size)
-
setLobMultiplier
public Size setLobMultiplier(Size.LobMultiplier lobMultiplier)
-
-