|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jso.schema.StorableField
Abstract class for field type mapping.
JDBCTypes
,
Serialized FormField Summary | |
static int |
BOOLEAN
Constant for the boolean primitive. |
static int |
BYTE
Constant for the byte primitive. |
static int |
CHAR
Constant for the char primitive. |
static int |
CONTAINER
Constant for container objects. |
static int |
DATE
Constant for date objects. |
static int |
DOUBLE
Constant for the double primitive. |
static int |
FLOAT
Constant for the float primitive. |
static int |
INT
Constant for the int primitive. |
static int |
LONG
Constant for the long primitive. |
static int |
NULL
Constant for "null" type. |
static int |
OBJECT
Constant for object references. |
static int |
SHORT
Constant for the short primitive. |
static int |
STRING
Constant for string objects. |
static int |
TEXT
Constant for text (large strings) objects. |
static int |
TIME
Constant for time objects. |
static int |
TIMESTAMP
Constant for timestamp (date/time) objects. |
static int |
VOID
Constant for the void type. |
Constructor Summary | |
StorableField()
|
Method Summary | |
static java.lang.Integer |
getJDBCTypeFor(int aType)
Maps attributte types to JDBC types, defined in java.sql.Types . |
static java.lang.Integer |
getJDBCTypeFor(java.lang.Integer aType)
Maps attributte types to JDBC types, defined in java.sql.Types . |
static java.lang.String |
getNameFor(int aType)
Returns the name of a storable type. |
static java.lang.String |
getNameFor(java.lang.Integer aType)
Returns the name of a storable type. |
static java.util.Set |
getValidTypes()
Returns a set of valid storable field type. |
static java.lang.Class |
getWrapperClass(java.lang.Integer aType)
Maps a storable field type to a class. |
static java.lang.Integer |
getWrapperType(java.lang.Class aClass)
Maps a wrapper class to a storable field type. |
static boolean |
isValidType(int aType)
Checks if a type is a valid storable field type. |
static boolean |
isValidType(java.lang.Integer aType)
Checks if a type is a valid storable field type. |
static void |
prepareField(java.sql.PreparedStatement aPs,
int anIndex,
java.lang.Integer aType,
java.lang.Object aValue)
Sets the value for a prepared statement's parameter. |
static java.lang.Object |
retrieveField(java.sql.ResultSet aRs,
int anIndex,
java.lang.Integer aType)
Retrieves a field value from a result set. |
static java.lang.Object |
retrieveField(java.sql.ResultSet aRs,
java.lang.String aField,
java.lang.Integer aType)
Retrieves a field value from a result set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NULL
public static final int VOID
public static final int BOOLEAN
public static final int BYTE
public static final int CHAR
public static final int DOUBLE
public static final int FLOAT
public static final int INT
public static final int LONG
public static final int SHORT
public static final int DATE
public static final int STRING
public static final int TEXT
public static final int TIME
public static final int TIMESTAMP
public static final int CONTAINER
public static final int OBJECT
Constructor Detail |
public StorableField()
Method Detail |
public static java.lang.Integer getWrapperType(java.lang.Class aClass)
aClass
- Wrapper class to be mapped.
null
if class is not storable.public static java.lang.Class getWrapperClass(java.lang.Integer aType)
aType
- Storable field type to be mapped.
null
if type is invalid.public static java.lang.Integer getJDBCTypeFor(int aType) throws java.lang.IllegalArgumentException
java.sql.Types
.
aType
- Attibute type.
java.lang.IllegalArgumentException
public static java.lang.Integer getJDBCTypeFor(java.lang.Integer aType) throws java.lang.IllegalArgumentException
java.sql.Types
.
aType
- Attibute type.
java.lang.IllegalArgumentException
public static boolean isValidType(int aType)
aType
- Type to be checked.
true
if the supplied type is valid; false
otherwise.public static boolean isValidType(java.lang.Integer aType)
aType
- Type to be checked.
true
if the supplied type is valid; false
otherwise.public static java.util.Set getValidTypes()
public static java.lang.String getNameFor(int aType) throws java.lang.IllegalArgumentException
aType
- Storable type.
java.lang.IllegalArgumentException
public static java.lang.String getNameFor(java.lang.Integer aType) throws java.lang.IllegalArgumentException
aType
- Storable type.
java.lang.IllegalArgumentException
public static java.lang.Object retrieveField(java.sql.ResultSet aRs, java.lang.String aField, java.lang.Integer aType) throws java.sql.SQLException
aRs
- The result set that contains field's value.aField
- Name of the field in the result set.aType
- Storable type.
java.sql.SQLException
public static java.lang.Object retrieveField(java.sql.ResultSet aRs, int anIndex, java.lang.Integer aType) throws java.sql.SQLException
aRs
- The result set that contains field's value.anIndex
- Index of the field in the result set.aType
- Storable type.
java.sql.SQLException
public static void prepareField(java.sql.PreparedStatement aPs, int anIndex, java.lang.Integer aType, java.lang.Object aValue) throws java.sql.SQLException
aPs
- The prepared statement containing the parameter.anIndex
- Index of the parameter.aType
- Storable type.aValue
- Parameter's value.
java.sql.SQLException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |