// Path: src/main/java/org/easyarch/slardar/jdbc/type/JAVAType.java
// public enum JAVAType {
//     INT(int.class,Integer.class),
//     CHAR(char.class,Character.class),
//     FLOAT(float.class,Float.class),
//     DOUBLE(double.class,Double.class),
//     LONG(long.class,Long.class),
//     SHORT(short.class,Short.class),
//     BOOL(boolean.class,Boolean.class),
//     BYTE(byte.class,Byte.class),
//     BYTEARRAY(byte[].class,Byte[].class),
//     STRING(String.class,String.class),
//     DATE(Date.class, java.sql.Date.class),
//     TIMESTAMP(Timestamp.class, Timestamp.class);
// 
//     public Class obj;
//     public Class base;
// 
//     JAVAType(Class base,Class obj) {
//         this.obj = obj;
//         this.base = base;
//     }
// 
//     public static JAVAType getType(Class cls){
//         for (JAVAType type:values()){
//             if (type.base.equals(cls)||type.obj.equals(cls)){
//                 return type;
//             }
//         }
//         throw new IllegalArgumentException("there is no type named "+cls.getTypeName()+" here");
//     }
// }


import org.easyarch.slardar.jdbc.type.JAVAType;
import java.sql.ResultSet;
import java.sql.SQLException;
package org.easyarch.slardar.jdbc.wrapper;



/**
 * Description :
 * Created by xingtianyu on 17-2-12
 * 下午10:18
 * description:
 */

public class BaseTypeWrapper<T> extends BeanWrapper<T> {

    public BaseTypeWrapper() {
        super(null);
    }

    @Override
    public T bean(ResultSet rs, Class<T> type) {
        try {
            if (rs.next()) {
// Path: src/main/java/org/easyarch/slardar/jdbc/type/JAVAType.java
// public enum JAVAType {
//     INT(int.class,Integer.class),
//     CHAR(char.class,Character.class),
//     FLOAT(float.class,Float.class),
//     DOUBLE(double.class,Double.class),
//     LONG(long.class,Long.class),
//     SHORT(short.class,Short.class),
//     BOOL(boolean.class,Boolean.class),
//     BYTE(byte.class,Byte.class),
//     BYTEARRAY(byte[].class,Byte[].class),
//     STRING(String.class,String.class),
//     DATE(Date.class, java.sql.Date.class),
//     TIMESTAMP(Timestamp.class, Timestamp.class);
// 
//     public Class obj;
//     public Class base;
// 
//     JAVAType(Class base,Class obj) {
//         this.obj = obj;
//         this.base = base;
//     }
// 
//     public static JAVAType getType(Class cls){
//         for (JAVAType type:values()){
//             if (type.base.equals(cls)||type.obj.equals(cls)){
//                 return type;
//             }
//         }
//         throw new IllegalArgumentException("there is no type named "+cls.getTypeName()+" here");
//     }
// }


// Path: src/main/java/org/easyarch/slardar/jdbc/wrapper/BaseTypeWrapper.java
import org.easyarch.slardar.jdbc.type.JAVAType;
import java.sql.ResultSet;
import java.sql.SQLException;

package org.easyarch.slardar.jdbc.wrapper;



/**
 * Description :
 * Created by xingtianyu on 17-2-12
 * 下午10:18
 * description:
 */

public class BaseTypeWrapper<T> extends BeanWrapper<T> {

    public BaseTypeWrapper() {
        super(null);
    }

    @Override
    public T bean(ResultSet rs, Class<T> type) {
        try {
            if (rs.next()) {
                switch (JAVAType.getType(type)){