java.lang.Object
org.objectstyle.cayenne.access.types.AbstractType
org.objectstyle.cayenne.access.types.DefaultType
org.objectstyle.cayenne.access.types.ShortType
- All Implemented Interfaces:
- ExtendedType
- public class ShortType
- extends DefaultType
Addresses bugs in certain JDBC drivers that do not handle java.lang.Short
properly. Recasts java.lang.Short to java.lang.Integer when
binding values to PreparedStatement. Drivers that are proven to have issues with
short values are Sybase and Oracle (Mac OS X only).
- Since:
- 1.0.2
|
Constructor Summary |
ShortType(boolean widenShorts)
|
|
Method Summary |
java.lang.String |
getClassName()
Returns a full name of Java class that this ExtendedType supports. |
java.lang.Object |
materializeObject(java.sql.CallableStatement st,
int index,
int type)
Reads an object from a stored procedure OUT parameter, converting it to class
returned by 'getClassName' method. |
java.lang.Object |
materializeObject(java.sql.ResultSet rs,
int index,
int type)
Reads an object from JDBC ResultSet column, converting it to class
returned by 'getClassName' method. |
void |
setJdbcObject(java.sql.PreparedStatement st,
java.lang.Object val,
int pos,
int type,
int precision)
Initializes a single parameter of a PreparedStatement with object value. |
widenShorts
protected boolean widenShorts
ShortType
public ShortType(boolean widenShorts)
getClassName
public java.lang.String getClassName()
- Description copied from interface:
ExtendedType
- Returns a full name of Java class that this ExtendedType supports.
- Specified by:
getClassName in interface ExtendedType- Overrides:
getClassName in class DefaultType
materializeObject
public java.lang.Object materializeObject(java.sql.ResultSet rs,
int index,
int type)
throws java.lang.Exception
- Description copied from interface:
ExtendedType
- Reads an object from JDBC ResultSet column, converting it to class
returned by 'getClassName' method.
- Specified by:
materializeObject in interface ExtendedType- Overrides:
materializeObject in class DefaultType
materializeObject
public java.lang.Object materializeObject(java.sql.CallableStatement st,
int index,
int type)
throws java.lang.Exception
- Description copied from interface:
ExtendedType
- Reads an object from a stored procedure OUT parameter, converting it to class
returned by 'getClassName' method.
- Specified by:
materializeObject in interface ExtendedType- Overrides:
materializeObject in class DefaultType
setJdbcObject
public void setJdbcObject(java.sql.PreparedStatement st,
java.lang.Object val,
int pos,
int type,
int precision)
throws java.lang.Exception
- Description copied from interface:
ExtendedType
- Initializes a single parameter of a PreparedStatement with object value.
- Specified by:
setJdbcObject in interface ExtendedType- Overrides:
setJdbcObject in class AbstractType