Documentation of 'org.hsqldb.types.CharacterType' Java class
CharacterType
org.hsqldb.types

Class CharacterType

  • All Implemented Interfaces:
    java.lang.Cloneable, SchemaObject
    Direct Known Subclasses:
    ClobType


    public class CharacterType
    extends Type
    Type subclass for CHARACTER, VARCHAR, etc.

    Since:
    1.9.0
    • Constructor Detail

      • CharacterType

        public CharacterType(Collation collation,
                             int type,
                             long precision)
      • CharacterType

        public CharacterType(int type,
                             long precision)
        Always ASCII collation
    • Method Detail

      • displaySize

        public int displaySize()
        Specified by:
        displaySize in class Type
      • getJDBCTypeCode

        public int getJDBCTypeCode()
        Description copied from class: Type
        Returns the JDBC type number of type, if it exists, otherwise the HSQLDB / SQL type.
        Specified by:
        getJDBCTypeCode in class Type
      • getJDBCClass

        public java.lang.Class getJDBCClass()
        Specified by:
        getJDBCClass in class Type
      • getJDBCClassName

        public java.lang.String getJDBCClassName()
        Description copied from class: Type
        Returns the JDBC class name of type, if it exists, otherwise the HSQLDB class name.
        Specified by:
        getJDBCClassName in class Type
      • getSQLGenericTypeCode

        public int getSQLGenericTypeCode()
        Description copied from class: Type
        Returns the generic SQL CLI type number of type, if it exists, otherwise the HSQLDB type. The generic type is returned for DATETIME and INTERVAL types.
        Overrides:
        getSQLGenericTypeCode in class Type
      • getNameString

        public java.lang.String getNameString()
        Description copied from class: Type
        Returns the name of the type
        Specified by:
        getNameString in class Type
      • getFullNameString

        public java.lang.String getFullNameString()
        Description copied from class: Type
        Returns the name of the type
        Overrides:
        getFullNameString in class Type
      • getDefinition

        public java.lang.String getDefinition()
        Description copied from class: Type
        Returns the full definition of the type, including parameters
        Specified by:
        getDefinition in class Type
      • isCharacterType

        public boolean isCharacterType()
        Overrides:
        isCharacterType in class Type
      • getAggregateType

        public Type getAggregateType(Type other)
        Description copied from class: Type
        Common type used in comparison opertions. other must be comparable with this.
        Specified by:
        getAggregateType in class Type
      • compare

        public int compare(Session session,
                           java.lang.Object a,
                           java.lang.Object b)
        Specified by:
        compare in class Type
      • compare

        public int compare(Session session,
                           java.lang.Object a,
                           java.lang.Object b,
                           int opType)
        Overrides:
        compare in class Type
      • castToType

        public java.lang.Object castToType(SessionInterface session,
                                           java.lang.Object a,
                                           Type otherType)
        Description copied from class: Type
        Explicit casts are handled by this method. SQL standard 6.12 rules for enforcement of size, precision and scale are implemented. For CHARACTER values, it performs truncation in all cases of long strings.
        Overrides:
        castToType in class Type
      • castOrConvertToType

        public java.lang.Object castOrConvertToType(SessionInterface session,
                                                    java.lang.Object a,
                                                    Type otherType,
                                                    boolean cast)
      • convertToType

        public java.lang.Object convertToType(SessionInterface session,
                                              java.lang.Object a,
                                              Type otherType)
        Description copied from class: Type
        Same as castToType except for CHARACTER values. Perform string truncation of trailing spaces only. For other long strings, it raises an exception.
        Specified by:
        convertToType in class Type
      • convertToTypeJDBC

        public java.lang.Object convertToTypeJDBC(SessionInterface session,
                                                  java.lang.Object a,
                                                  Type otherType)
        Description copied from class: Type
        Convert type for JDBC reads. Same as convertToType, but supports non-standard SQL conversions supported by JDBC
        Overrides:
        convertToTypeJDBC in class Type
      • convertToDefaultType

        public java.lang.Object convertToDefaultType(SessionInterface session,
                                                     java.lang.Object a)
        Relaxes SQL parameter type enforcement, allowing long strings.
        Specified by:
        convertToDefaultType in class Type
      • convertToString

        public java.lang.String convertToString(java.lang.Object a)
        Specified by:
        convertToString in class Type
      • convertToSQLString

        public java.lang.String convertToSQLString(java.lang.Object a)
        Specified by:
        convertToSQLString in class Type
      • canConvertFrom

        public boolean canConvertFrom(Type otherType)
        Specified by:
        canConvertFrom in class Type
      • canMoveFrom

        public int canMoveFrom(Type otherType)
        Description copied from class: Type
        Can convert without changing the object
        Overrides:
        canMoveFrom in class Type
        Returns:
        0 always, 1 range check required, -1 never
      • position

        public long position(SessionInterface session,
                             java.lang.Object data,
                             java.lang.Object otherData,
                             Type otherType,
                             long offset)
      • substring

        public java.lang.Object substring(SessionInterface session,
                                          java.lang.Object data,
                                          long offset,
                                          long length,
                                          boolean hasLength,
                                          boolean trailing)
      • upper

        public java.lang.Object upper(Session session,
                                      java.lang.Object data)
        Memory limits apply to Upper and Lower implementations with Clob data
      • lower

        public java.lang.Object lower(Session session,
                                      java.lang.Object data)
      • trim

        public java.lang.Object trim(SessionInterface session,
                                     java.lang.Object data,
                                     char trim,
                                     boolean leading,
                                     boolean trailing)
      • overlay

        public java.lang.Object overlay(SessionInterface session,
                                        java.lang.Object data,
                                        java.lang.Object overlay,
                                        long offset,
                                        long length,
                                        boolean hasLength)
      • concat

        public java.lang.Object concat(Session session,
                                       java.lang.Object a,
                                       java.lang.Object b)
        Overrides:
        concat in class Type
      • match

        public java.lang.Boolean match(Session session,
                                       java.lang.String string,
                                       java.lang.String[] array)
        Matches the string against array containing part strings. Null element in array indicates skip one character. Empty string in array indicates skip any number of characters.
      • getCharacterType

        public Type getCharacterType(long length)
      • getRightTrimSise

        public static int getRightTrimSise(java.lang.String s,
                                           char trim)
      • getCharacterType

        public static CharacterType getCharacterType(int type,
                                                     long length)
      • getCharacterType

        public static CharacterType getCharacterType(int type,
                                                     long length,
                                                     Collation collation)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.