func createGorm(setting *Setting) (DB, error) {
	db, err := gorm.Open(
		setting.Dialect(),
		setting.URL,
	)
	if err != nil {
		return nil, err
	}
	log.Info("Open Database !")

	db.SingularTable(true)
	if log.IsDebugEnabled() {
		db.LogMode(true)
	}
	db.DB()
	if setting.MaxIdleConns > 0 {
		db.DB().SetMaxIdleConns(setting.MaxIdleConns)
	}
	if setting.MaxOpenConns > 0 {
		db.DB().SetMaxOpenConns(setting.MaxOpenConns)
	}
	return &gormDB{
		Dbm: &db,
	}, nil
}
func (t *BigIntType) UnmarshalJSON(data []byte) error {
	if data == nil {
		return nil
	}
	sVal := string(data)
	if sVal == `""` || sVal == "null" {
		return nil
	}
	if strings.HasPrefix(sVal, "\"") && strings.HasPrefix(sVal, "\"") {
		t.Set(sVal[1 : len(sVal)-1])
	} else {
		t.Set(sVal)
	}
	if log.IsDebugEnabled() {
		log.Debugf("UnmarshalJSON BigIntType: %v => %v", sVal, t)
	}
	return nil
}
func (t *TimestampType) UnmarshalJSON(data []byte) error {
	if data == nil {
		return nil
	}
	sVal := string(data)
	if sVal == `""` || sVal == "null" || sVal == `"0000-00-00+00:00:00"` {
		return nil
	}
	sVal = strings.Replace(sVal, "\"", "", -1)
	sVal = strings.Replace(sVal, "+", " ", -1)
	if sVal != "" {
		if strings.Contains(sVal, "-") {
			t.Set(sVal)
		} else {
			t.Set(time.Unix(util.ToInt64(sVal), 0).Add(9 * time.Hour)) //TODO Long値で取得した場合,UTC=>JSTへの変換が必要
		}
	}
	if log.IsDebugEnabled() {
		log.Debugf("UnmarshalJSON TimestampType: %v => %v", sVal, t)
	}
	return nil
}