示例#1
0
 @SuppressWarnings("unchecked")
 public Object jdbcGet(IResultSet rs, int n) throws SQLException {
   String s = rs.getString(n);
   if (s == null || s.length() == 0) return null;
   if (isOrdinal) {
     int cnt = StringUtils.toInt(s, 0);
     Enum<?>[] enums = clz.asSubclass(Enum.class).getEnumConstants();
     return enums[cnt];
   } else {
     return Enum.valueOf(clz.asSubclass(Enum.class), s);
   }
 }
示例#2
0
 @Override
 public Object jdbcGet(IResultSet rs, int n) throws SQLException {
   String o = rs.getString(n);
   if (StringUtils.isEmpty(o)) return null;
   return JSON.parseObject(o, this.getFieldAccessor().getGenericType());
 }
 public Object jdbcGet(IResultSet rs, int n) throws SQLException {
   Object obj = rs.getObject(n);
   if (obj == null) return null;
   if (obj instanceof Double) return obj;
   return ((Number) obj).doubleValue();
 }
示例#4
0
 public Object jdbcGet(IResultSet rs, int n) throws SQLException {
   Object obj = rs.getObject(n);
   if (obj == null) return null;
   return obj.toString();
 }