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. IMPL 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 definitions, by standard, are allowed a "multiplier" consisting of 'K' (Kb), 'M' (Mb) or 'G' (Gb).- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Size.LobMultiplier
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_LENGTH
static int
DEFAULT_PRECISION
static int
DEFAULT_SCALE
-
Constructor Summary
Constructors Constructor Description Size()
Size(int precision, int scale, long length, Size.LobMultiplier lobMultiplier)
Complete constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getLength()
Size.LobMultiplier
getLobMultiplier()
int
getPrecision()
int
getScale()
void
initialize(Size size)
static Size
length(long length)
static Size
length(long length, Size.LobMultiplier lobMultiplier)
static Size
precision(int precision)
static Size
precision(int precision, int scale)
void
setLength(long length)
void
setLobMultiplier(Size.LobMultiplier lobMultiplier)
void
setPrecision(int precision)
void
setScale(int scale)
-
-
-
Field Detail
-
DEFAULT_LENGTH
public static final int DEFAULT_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(int precision, int scale, long length, Size.LobMultiplier lobMultiplier)
Complete constructor.- Parameters:
precision
- numeric precisionscale
- numeric scalelength
- type lengthlobMultiplier
- LOB length multiplier
-
-
Method Detail
-
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 int getPrecision()
-
getScale
public int getScale()
-
getLength
public long getLength()
-
getLobMultiplier
public Size.LobMultiplier getLobMultiplier()
-
initialize
public void initialize(Size size)
-
setPrecision
public void setPrecision(int precision)
-
setScale
public void setScale(int scale)
-
setLength
public void setLength(long length)
-
setLobMultiplier
public void setLobMultiplier(Size.LobMultiplier lobMultiplier)
-
-