org.hibernate.metamodel.relational
Class Size

java.lang.Object
  extended by org.hibernate.metamodel.relational.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
static class Size.LobMultiplier
           
 
Field Summary
static int DEFAULT_LENGTH
           
static int DEFAULT_PRECISION
           
static int DEFAULT_SCALE
           
 
Constructor Summary
Size()
           
Size(int precision, int scale, long length, Size.LobMultiplier lobMultiplier)
          Complete constructor.
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 precision
scale - numeric scale
length - type length
lobMultiplier - 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)


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.