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 classSize.LobMultiplier
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_LENGTHstatic longDEFAULT_LOB_LENGTHstatic intDEFAULT_PRECISIONstatic intDEFAULT_SCALEstatic longLONG_LENGTH
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LonggetLength()Size.LobMultipliergetLobMultiplier()IntegergetPrecision()IntegergetScale()voidinitialize(Size size)static Sizelength(long length)static Sizelength(long length, Size.LobMultiplier lobMultiplier)static Sizenil()static Sizeprecision(int precision)static Sizeprecision(int precision, int scale)SizesetLength(Long length)SizesetLobMultiplier(Size.LobMultiplier lobMultiplier)SizesetPrecision(Integer precision)SizesetScale(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)
-
-