01: package net.sourceforge.jaxor.mappers;
02:
03: import net.sourceforge.jaxor.api.Mapper;
04: import net.sourceforge.jaxor.MetaField;
05:
06: import java.sql.ResultSet;
07: import java.sql.SQLException;
08: import java.sql.Types;
09:
10: /**
11: * Created By: Mike
12: * Date: Jan 21, 2004
13: * Time: 8:58:22 PM
14: *
15: * Last Checkin: $Author: mrettig $
16: * Date: $Date: 2004/02/09 06:35:41 $
17: * Revision: $Revision: 1.2 $
18: */
19: public class ShortMapper extends MapperBase {
20:
21: public int getSQLType() {
22: return Types.SMALLINT;
23: }
24:
25: public Object getValueFromResultSet(ResultSet rs, MetaField field)
26: throws SQLException {
27: short anInt = rs.getShort(field.getColumn());
28: if (!rs.wasNull())
29: return new Short(anInt);
30: return null;
31: }
32: }
|