Package org.hibernate.engine.jdbc
Class Size
- java.lang.Object
-
- org.hibernate.engine.jdbc.Size
-
- All Implemented Interfaces:
java.io.Serializable
public class Size extends java.lang.Object implements java.io.SerializableModels 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 classSize.LobMultiplier
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_LENGTHstatic intDEFAULT_PRECISIONstatic intDEFAULT_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 longgetLength()Size.LobMultipliergetLobMultiplier()intgetPrecision()intgetScale()voidinitialize(Size size)static Sizelength(long length)static Sizelength(long length, Size.LobMultiplier lobMultiplier)static Sizeprecision(int precision)static Sizeprecision(int precision, int scale)voidsetLength(long length)voidsetLobMultiplier(Size.LobMultiplier lobMultiplier)voidsetPrecision(int precision)voidsetScale(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)
-
-