Package net.sf.basedb.core.hibernate
Class TypeWrapper<T extends org.hibernate.type.Type>
- java.lang.Object
-
- net.sf.basedb.core.hibernate.TypeWrapper<T>
-
public class TypeWrapper<T extends org.hibernate.type.Type> extends Object
Wrapper class for Hibernate types that will try to "hide" issues with the redesign of the type system in Hibernate that is going on in Hibernate 3.5.2 --> Hibernate 3.6.- Since:
- 2.16
- Author:
- Nicklas
- Last modified
- $Date: 2017-05-22 14:35:27 +0200 (må, 22 maj 2017) $
-
-
Field Summary
Fields Modifier and Type Field Description static TypeWrapper<org.hibernate.type.BooleanType>
BOOLEAN
static TypeWrapper<org.hibernate.type.DateType>
DATE
static TypeWrapper<org.hibernate.type.DoubleType>
DOUBLE
static TypeWrapper<org.hibernate.type.FloatType>
FLOAT
static org.hibernate.type.BooleanType
H_BOOLEAN
static org.hibernate.type.DateType
H_DATE
static org.hibernate.type.DoubleType
H_DOUBLE
static org.hibernate.type.FloatType
H_FLOAT
static org.hibernate.type.IntegerType
H_INTEGER
static org.hibernate.type.LongType
H_LONG
static org.hibernate.type.ShortType
H_SHORT
static org.hibernate.type.StringType
H_STRING
static org.hibernate.type.TextType
H_TEXT
static org.hibernate.type.TimestampType
H_TIMESTAMP
private T
hibernateType
static TypeWrapper<org.hibernate.type.IntegerType>
INTEGER
static TypeWrapper<org.hibernate.type.LongType>
LONG
static TypeWrapper<org.hibernate.type.ShortType>
SHORT
private int
size
private int
sqlType
static TypeWrapper<org.hibernate.type.StringType>
STRING
static TypeWrapper<org.hibernate.type.TextType>
TEXT
static TypeWrapper<org.hibernate.type.TimestampType>
TIMESTAMP
-
Constructor Summary
Constructors Modifier Constructor Description protected
TypeWrapper(T hibernateType, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getApproximateSize()
Get the number of bytes a single value for this type occupies in a database (approximately).T
getHibernateType()
Get the underlying Hibernate type.int
getSQLType()
Get the SQL code for database columns that can store this type.
-
-
-
Field Detail
-
SHORT
public static final TypeWrapper<org.hibernate.type.ShortType> SHORT
-
H_SHORT
public static final org.hibernate.type.ShortType H_SHORT
-
INTEGER
public static final TypeWrapper<org.hibernate.type.IntegerType> INTEGER
-
H_INTEGER
public static final org.hibernate.type.IntegerType H_INTEGER
-
LONG
public static final TypeWrapper<org.hibernate.type.LongType> LONG
-
H_LONG
public static final org.hibernate.type.LongType H_LONG
-
FLOAT
public static final TypeWrapper<org.hibernate.type.FloatType> FLOAT
-
H_FLOAT
public static final org.hibernate.type.FloatType H_FLOAT
-
DOUBLE
public static final TypeWrapper<org.hibernate.type.DoubleType> DOUBLE
-
H_DOUBLE
public static final org.hibernate.type.DoubleType H_DOUBLE
-
STRING
public static final TypeWrapper<org.hibernate.type.StringType> STRING
-
H_STRING
public static final org.hibernate.type.StringType H_STRING
-
TEXT
public static final TypeWrapper<org.hibernate.type.TextType> TEXT
-
H_TEXT
public static final org.hibernate.type.TextType H_TEXT
-
BOOLEAN
public static final TypeWrapper<org.hibernate.type.BooleanType> BOOLEAN
-
H_BOOLEAN
public static final org.hibernate.type.BooleanType H_BOOLEAN
-
DATE
public static final TypeWrapper<org.hibernate.type.DateType> DATE
-
H_DATE
public static final org.hibernate.type.DateType H_DATE
-
TIMESTAMP
public static final TypeWrapper<org.hibernate.type.TimestampType> TIMESTAMP
-
H_TIMESTAMP
public static final org.hibernate.type.TimestampType H_TIMESTAMP
-
hibernateType
private final T extends org.hibernate.type.Type hibernateType
-
sqlType
private final int sqlType
-
size
private final int size
-
-
Constructor Detail
-
TypeWrapper
protected TypeWrapper(T hibernateType, int size)
-
-
Method Detail
-
getHibernateType
public T getHibernateType()
Get the underlying Hibernate type.
-
getSQLType
public int getSQLType()
Get the SQL code for database columns that can store this type.- Returns:
- A code, or 0 if not applicable to the given type
- See Also:
Types
-
getApproximateSize
public int getApproximateSize()
Get the number of bytes a single value for this type occupies in a database (approximately). If the type represents a variable-length property, 0 is returned.- Returns:
- The number of bytes required in the database or 0 if not known
- Since:
- 3.1
-
-