List of utility methods to do SQL Type
boolean | isPlainJdbcType(int type) is Plain Jdbc Type return type != Types.ARRAY && type != Types.BLOB && type != Types.CLOB && type != Types.DATALINK
&& type != Types.JAVA_OBJECT && type != Types.NCHAR && type != Types.NVARCHAR
&& type != Types.LONGNVARCHAR && type != Types.REF && type != Types.ROWID && type != Types.SQLXML;
|
boolean | isPrecisionRequired(int jdbcType) is Precision Required switch (jdbcType) { case Types.BIT: case Types.BIGINT: case Types.BOOLEAN: case Types.INTEGER: case Types.SMALLINT: case Types.TINYINT: case Types.FLOAT: ... |
boolean | isPrimitive(Class type) is Primitive return (type == Integer.class || type == Double.class || type == String.class || type == Date.class || type == Boolean.class || type == BigDecimal.class || type == Timestamp.class || type == Long.class); |
boolean | isPrimitiveCollection(Method m) is Primitive Collection if (!Collection.class.isAssignableFrom(m.getReturnType())) return false; return isPrimitive(extractCollection(m)); |
boolean | isScaleRequired(int type) is Scale Required switch (type) { case java.sql.Types.DECIMAL: case java.sql.Types.NUMERIC: return true; default: return false; |
boolean | isSerializationClass(Class clazz) is Serialization Class return clazz.equals(Blob.class) || clazz.equals(InputStream.class); |
boolean | isSimpleType(Class> type) is Simple Type for (Class<?> simpleType : SIMPLE_TYPES) { if (simpleType.equals(type)) return true; return false; |
boolean | isSqlTypeBinayBased(int javaSqlType) Tells wether a column is binary like type or not. return (javaSqlType == Types.BINARY) || (javaSqlType == Types.BLOB) || (javaSqlType == Types.VARBINARY)
|| (javaSqlType == Types.LONGVARBINARY);
|
boolean | isSqlTypeSupported(int sqlType) is Sql Type Supported return sqlType != Types.REF_CURSOR && sqlType != Types.TIME_WITH_TIMEZONE
&& sqlType != Types.TIMESTAMP_WITH_TIMEZONE;
|
boolean | isString(int colType) Checks whether the given column type represents strings. return (colType == Types.CHAR) || (colType == Types.CLOB) || (colType == Types.LONGNVARCHAR)
|| (colType == Types.LONGVARCHAR) || (colType == Types.NCHAR) || (colType == Types.NVARCHAR)
|| (colType == Types.VARCHAR);
|