class KeyHolder {

    static void setPrimaryKey(Field pkFlield, Object entity, Number val) throws SQLException {
        try {
            if (val == null) {
                pkFlield.set(entity, null);
                return;
            }

            Class<?> clazz = pkFlield.getType();
            if (clazz.equals(Long.class) || clazz.equals(long.class)) {
                pkFlield.set(entity, val.longValue());
                return;
            }
            if (clazz.equals(Integer.class) || clazz.equals(int.class)) {
                pkFlield.set(entity, val.intValue());
                return;
            }
            if (clazz.equals(Byte.class) || clazz.equals(byte.class)) {
                pkFlield.set(entity, val.byteValue());
                return;
            }
            if (clazz.equals(Short.class) || clazz.equals(short.class)) {
                pkFlield.set(entity, val.shortValue());
                return;
            }
            if (clazz.equals(BigInteger.class)) {
                BigInteger bigIntegerValue = BigInteger.valueOf(val.longValue());
                pkFlield.set(entity, bigIntegerValue);
                return;
            }
        } catch (Throwable e) {
            throw new DasException(ErrorCode.SetPrimaryKeyFailed, entity.getClass().getName(), pkFlield.getName());
        }
    }

    public  KeyHolder();

}