Get attribute of mysql type: varchar, char, enum, set, text, tinytext, mediumtext, longtext
976009
public String getStr(String attr) {
		// return (String)attrs.get(attr);
		Object s = attrs.get(attr);
		return s != null ? s.toString() : null;
	}
541090
@Override
    public int getSqlType(String paramName) {
        if (!hasValue(paramName)) {
            return TYPE_UNKNOWN;
        }
        Object value = getValue(paramName);
        return StatementCreatorUtils.javaTypeToSqlParameterType(value.getClass());
    }
668292
def cql_encode_all_types(self, val, as_text_type=False):
        
        encoded = self.mapping.get(type(val), self.cql_encode_object)(val)
        if as_text_type and not isinstance(encoded, six.text_type):
            return encoded.decode('utf-8')
        return encoded
25190
public Serializable getSQLValue(Attribute<T, Serializable> attr, T entity) {
        Serializable val = attr.get(entity);
        CryptHandler cryptHandler = attr.attach();
        if (cryptHandler != null) val = (Serializable) cryptHandler.encrypt(val);
        return val;
    }
794554
private void getAttributes(Context context, AttributeSet attrs) {
        TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.PinView);

        if (typedArray != null) {
            try {
                mNumberPinBoxes = typedArray
                        .getInteger(R.styleable.PinView_numberPinBoxes, PinViewSettings.DEFAULT_NUMBER_PIN_BOXES);
                mMaskPassword = typedArray
                        .getBoolean(R.styleable.PinView_password, PinViewSettings.DEFAULT_MASK_PASSWORD);
                mNumberCharacters = typedArray
                        .getInteger(R.styleable.PinView_numberCharacters, PinViewSettings.DEFAULT_NUMBER_CHARACTERS);
                mSplit = typedArray.getString(R.styleable.PinView_split);
                mKeyboardMandatory = typedArray
                        .getBoolean(R.styleable.PinView_keyboardMandatory, PinViewSettings.DEFAULT_KEYBOARD_MANDATORY);
                mDeleteOnClick = typedArray
                        .getBoolean(R.styleable.PinView_deleteOnClick, PinViewSettings.DEFAULT_DELETE_ON_CLICK);
                mNativePinBox = typedArray
                        .getBoolean(R.styleable.PinView_nativePinBox, PinViewSettings.DEFAULT_NATIVE_PIN_BOX);
                mCustomDrawablePinBox = typedArray
                        .getResourceId(R.styleable.PinView_drawablePinBox, PinViewSettings.DEFAULT_CUSTOM_PIN_BOX);
                mColorTextPinBoxes = typedArray
                        .getColor(R.styleable.PinView_colorTextPinBox,
                                getResources().getColor(PinViewSettings.DEFAULT_TEXT_COLOR_PIN_BOX));
                mColorTextTitles = typedArray
                        .getColor(R.styleable.PinView_colorTextTitles,
                                getResources().getColor(PinViewSettings.DEFAULT_TEXT_COLOR_TITLES));
                mColorSplit = typedArray
                        .getColor(R.styleable.PinView_colorSplit,
                                getResources().getColor(PinViewSettings.DEFAULT_COLOR_SPLIT));
                mTextSizePinBoxes = typedArray
                        .getDimension(R.styleable.PinView_textSizePinBox,
                                getResources().getDimension(PinViewSettings.DEFAULT_TEXT_SIZE_PIN_BOX));
                mTextSizeTitles = typedArray
                        .getDimension(R.styleable.PinView_textSizeTitles,
                                getResources().getDimension(PinViewSettings.DEFAULT_TEXT_SIZE_TITLES));
                mSizeSplit = typedArray
                        .getDimension(R.styleable.PinView_sizeSplit,
                                getResources().getDimension(PinViewSettings.DEFAULT_SIZE_SPLIT));

                int titles;
                titles = typedArray.getResourceId(R.styleable.PinView_titles, -1);
                if (titles != -1) {
                    setTitles(getResources().getStringArray(titles));
                }

                if (this.mNumberPinBoxes != 0) {
                    setPin(this.mNumberPinBoxes);
                }

            } catch (Exception e) {
                Log.e(LOG_TAG, "Error while creating the view PinView: ", e);
            } finally {
                typedArray.recycle();
            }
        }
    }
701542
public function getTypeQuery()
    {

        switch( true ) {

            case $this->name === 'timestamp':
            case $this->name === 'bool':

                return $this->name;

            case $this->isEnum(): // enum's behave like strings

                return $this->name;

            case $this->name === 'bpchar': // "blank-padded char", the internal name of the 'character' data type
            case $this->name === 'text':

                return 'text';

            case $this->name === 'int2':
            case $this->name === 'int4':
            case $this->name === 'int8':

                return 'int';

            default:

                return $this->name;
                throw new \UnexpectedValueException( "type::pgTypeToQueryValidateType doesnt know about type `{$type}`" );

        }

    }
7534
static String getSqlAddColumn(EntityType entityType, Attribute attr, ColumnMode columnMode) {
    StringBuilder sql = new StringBuilder("ALTER TABLE ");

    String columnSql = getSqlColumn(entityType, attr, columnMode);
    sql.append(getTableName(entityType)).append(" ADD ").append(columnSql);

    List<String> sqlTableConstraints = getSqlTableConstraints(entityType, attr);
    if (!sqlTableConstraints.isEmpty()) {
      sqlTableConstraints.forEach(
          sqlTableConstraint -> sql.append(",ADD ").append(sqlTableConstraint));
    }
    return sql.toString();
  }
1295201
def get_type(self):
        

        ext = self.match.group(5)

        if ext == 'pre.py':
            return DeltaType.PRE_PYTHON
        elif ext == 'pre.sql':
            return DeltaType.PRE_SQL
        elif ext == 'py':
            return DeltaType.PYTHON
        elif ext == 'sql':
            return DeltaType.SQL
        elif ext == 'post.py':
            return DeltaType.POST_PYTHON
        elif ext == 'post.sql':
            return DeltaType.POST_SQL
1147220
def get_datatype(cls,
                     db: DATABASE_SUPPORTER_FWD_REF,
                     table: str,
                     column: str) -> str:
        """"""
        raise RuntimeError(_MSG_NO_FLAVOUR)
145178
public static String getSqlTypeAsString(int jdbcType)
    {
        String statusName = "*can't find String representation for sql type '" + jdbcType + "'*";
        try
        {
            Field[] fields = Types.class.getDeclaredFields();
            for (int i = 0; i < fields.length; i++)
            {
                if (fields[i].getInt(null) == jdbcType)
                {
                    statusName = fields[i].getName();
                    break;
                }
            }
        }
        catch (Exception ignore)
        {
            // ignore it
        }
        return statusName;
    }
535098
public String getStr(String field, Charset charset) {
		final Object obj = get(field);
		if (obj instanceof Clob) {
			return SqlUtil.clobToStr((Clob) obj);
		} else if (obj instanceof Blob) {
			return SqlUtil.blobToStr((Blob) obj, charset);
		} else if (obj instanceof RowId) {
			final RowId rowId = (RowId) obj;
			return StrUtil.str(rowId.getBytes(), charset);
		}
		return super.getStr(field);
	}
226466
def _get_dbal_column_type(self, type_):
        
        type_ = type_.lower()

        if type_ == "enum":
            return "string"

        return super(SQLiteSchemaGrammar, self)._get_dbal_column_type(type_)
755173
private static String getKMLType(int sqlTypeId, String sqlTypeName) throws SQLException {
        switch (sqlTypeId) {
            case Types.BOOLEAN:
                return "bool";
            case Types.DOUBLE:
                return "double";
            case Types.FLOAT:
                return "float";
            case Types.INTEGER:
            case Types.BIGINT:
                return "int";
            case Types.SMALLINT:
                return "short";
            case Types.DATE:
            case Types.VARCHAR:
            case Types.NCHAR:
            case Types.CHAR:
                return "string";
            default:
                throw new SQLException("Field type not supported by KML : " + sqlTypeName);
        }
    }
138604
public final Object convert(Class<?> type, String s) throws ParseException {
		// mysql type: varchar, char, enum, set, text, tinytext, mediumtext, longtext
		if (type == String.class) {
			return ("".equals(s) ? null : s);	// 用户在表单域中没有输入内容时将提交过来 "", 因为没有输入,所以要转成 null.
		}
		s = s.trim();
		if ("".equals(s)) {	// 前面的 String跳过以后,所有的空字符串全都转成 null,  这是合理的
			return null;
		}
		// 以上两种情况无需转换,直接返回, 注意, 本方法不接受null为 s 参数(经测试永远不可能传来null, 因为无输入传来的也是"")
		//String.class提前处理
		
		// --------
		IConverter<?> converter = converterMap.get(type);
		if (converter != null) {
			return converter.convert(s);
		}
		if (JFinal.me().getConstants().getDevMode()) {
			throw new RuntimeException("Please add code in " + TypeConverter.class  + ". The type can't be converted: " + type.getName());
		} else {
			throw new RuntimeException(type.getName() + " can not be converted, please use other type of attributes in your model!");
		}
	}
741380
@Override
	public int getColumnType(int column) throws RemoteException {
		String fldname = getColumnName(column);
		return schema.type(fldname).getSqlType();
	}
223002
def attribute_string(self):
        
        escape_map = {ord('='): '%3D',
                      ord(','): '%2C',
                      ord(';'): '%3B',
                      ord('&'): '%26',
                      ord('\t'): '%09',
                     }

        list_type = type(list())

        attrs = self.attributes
        if type(attrs) is OrderedDict:
            reserved_attrs = []
            other_attrs = []

            for name, value in attrs.items():
                # Escape reserved characters
                name = name.translate(escape_map)

                if type(value) == list_type:
                    value = ','.join([i.translate(escape_map) for i in value])
                else:
                    value = value.translate(escape_map)

                # Regain original formatting of attribute column
                out_attr = '{0}={1}'.format(name, value)

                # Order attributes so that reserved tags are output first
                if name[0].isupper():
                    reserved_attrs.append(out_attr)
                else:
                    other_attrs.append(out_attr)

            out_attrs = ';'.join(reserved_attrs + other_attrs)

        else:
            out_attrs = attrs

        return out_attrs
594935
function (column) {
            if (column.fixed) {
                return ["char(", column.size || 255, ")"].join("");
            } else if (column.text === false || column.size) {
                return ["varchar(", column.size || 255, ")"].join("");
            } else {
                return 'text';
            }

        }