Top Description Inners Fields Constructors Methods
org.hibernate.engine.jdbc

public Class Size

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
org.hibernate.Length, java.io.Serializable

Models size restrictions/requirements on a column's datatype.

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) or G (Gb).

Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private Integer
public static final long
public static final long
public static final int
public static final int
private Long
private Size.LobMultiplier
public static final long
private Integer
private Integer

Constructor Summary

AccessConstructor and Description
public
Size()

public
Size(Integer
numeric precision
precision
,
Integer
numeric scale
scale
,
Long
type length
length
,
Size.LobMultiplier
LOB length multiplier
lobMultiplier
)

Complete constructor.

public
Size(Integer precision, Integer scale, Integer length, Size.LobMultiplier lobMultiplier)

Method Summary

Modifier and TypeMethod and Description
public Integer
public Long
public Size.LobMultiplier
public Integer
public Integer
public void
public static Size
length(long length)

public static Size
length(long length, Size.LobMultiplier lobMultiplier)

public static Size
nil()

public static Size
precision(int precision)

public static Size
precision(int precision, int scale)

public Size
setArrayLength(Integer arrayLength)

public Size
setLength(Long length)

public Size
public Size
setPrecision(Integer precision)

public Size
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arrayLengthback to summary
private Integer arrayLength
DEFAULT_LENGTHback to summary
public static final long DEFAULT_LENGTH
DEFAULT_LOB_LENGTHback to summary
public static final long DEFAULT_LOB_LENGTH
DEFAULT_PRECISIONback to summary
public static final int DEFAULT_PRECISION
DEFAULT_SCALEback to summary
public static final int DEFAULT_SCALE
lengthback to summary
private Long length
lobMultiplierback to summary
private Size.LobMultiplier lobMultiplier
LONG_LENGTHback to summary
public static final long LONG_LENGTH
precisionback to summary
private Integer precision
scaleback to summary
private Integer scale

Constructor Detail

Sizeback to summary
public Size()
Sizeback to summary
public Size(Integer precision, Integer scale, Long length, Size.LobMultiplier lobMultiplier)

Complete constructor.

Parameters
precision:Integer

numeric precision

scale:Integer

numeric scale

length:Long

type length

lobMultiplier:Size.LobMultiplier

LOB length multiplier

Sizeback to summary
public Size(Integer precision, Integer scale, Integer length, Size.LobMultiplier lobMultiplier)

Method Detail

getArrayLengthback to summary
public Integer getArrayLength()
getLengthback to summary
public Long getLength()
getLobMultiplierback to summary
public Size.LobMultiplier getLobMultiplier()
getPrecisionback to summary
public Integer getPrecision()
getScaleback to summary
public Integer getScale()
initializeback to summary
public void initialize(Size size)
lengthback to summary
public static Size length(long length)
lengthback to summary
public static Size length(long length, Size.LobMultiplier lobMultiplier)
nilback to summary
public static Size nil()
precisionback to summary
public static Size precision(int precision)
precisionback to summary
public static Size precision(int precision, int scale)
setArrayLengthback to summary
public Size setArrayLength(Integer arrayLength)
setLengthback to summary
public Size setLength(Long length)
setLobMultiplierback to summary
public Size setLobMultiplier(Size.LobMultiplier lobMultiplier)
setPrecisionback to summary
public Size setPrecision(Integer precision)
setScaleback to summary
public Size setScale(Integer scale)
org.hibernate.engine.jdbc back to summary

public final Enum Size.LobMultiplier

extends Enum<Size.LobMultiplier>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final long
public static final Size.LobMultiplier
G

public static final Size.LobMultiplier
K

public static final Size.LobMultiplier
M

public static final Size.LobMultiplier

Constructor Summary

AccessConstructor and Description
private
LobMultiplier(long factor)

Method Summary

Modifier and TypeMethod and Description
public long
public static Size.LobMultiplier
public static Size.LobMultiplier[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

factorback to summary
private final long factor
Gback to summary
public static final Size.LobMultiplier G
Kback to summary
public static final Size.LobMultiplier K
Mback to summary
public static final Size.LobMultiplier M
NONEback to summary
public static final Size.LobMultiplier NONE

Constructor Detail

LobMultiplierback to summary
private LobMultiplier(long factor)

Method Detail

getFactorback to summary
public long getFactor()
valueOfback to summary
public static Size.LobMultiplier valueOf(String name)
valuesback to summary
public static Size.LobMultiplier[] values()