org.modeshape.jdbc

## Class JcrType

- java.lang.Object
- - org.modeshape.jdbc.JcrType

-     public final class JcrType
      extends Object

  Provides functionality to convert from JCR `PropertyType`s and JDBC types.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `JcrType.DefaultDataTypes`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `JcrType(int jcrType, int jdbcType, String typeName, Class<?> clazz, int displaySize, int precision, Transform transform)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Integer` | `getDefaultPrecision()` Get the default precision used for this JcrType
    `String` | `getJcrName()` Get the name of the JCR type.
    `int` | `getJcrType()` Get the JCR `PropertyType` value.
    `int` | `getJdbcType()` Get the JDBC `Types` value.
    `String` | `getJdbcTypeName()` Get the native type name associated with the JDBC `Types` value.
    `int` | `getNominalDisplaySize()` Get the nominal display size for the given type.
    `Class<?>` | `getRepresentationClass()` Get the Java class used to represent values for this type.
    `protected Transform` | `getTransform()` Return the `Transform` object to use to transform the `Value` to the correct data type.
    `boolean` | `isCaseSensitive()` Get the indicator if the value is case sensitive
    `boolean` | `isSigned()` Get the indicator if the value is considered a signed value.
    `static String` | `jdbcType(String jcrTypeName)`
    `Object` | `translateValue(Value value)`
    `static Object` | `translateValueToJDBC(Value value)`
    `static JcrType` | `typeInfo(int jcrType)`
    `static JcrType` | `typeInfo(String jcrTypeName)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JcrType

          protected JcrType(int jcrType,
                 int jdbcType,
                 String typeName,
                 Class<?> clazz,
                 int displaySize,
                 int precision,
                 Transform transform)

  - ### Method Detail

    - #### getJcrName

          public String getJcrName()

      Get the name of the JCR type.
      Returns:
        the JCR type name; never null

    - #### getJcrType

          public int getJcrType()

      Get the JCR `PropertyType` value.
      Returns:
        the JCR property type; never null

    - #### getJdbcType

          public int getJdbcType()

      Get the JDBC `Types` value.
      Returns:
        the JDBC type; never null

    - #### getJdbcTypeName

          public String getJdbcTypeName()

      Get the native type name associated with the JDBC `Types` value.
      Returns:
        the native JDBC type name; never null

    - #### getDefaultPrecision

          public Integer getDefaultPrecision()

      Get the default precision used for this JcrType
      Returns:
        the Integer form of the precision

    - #### getTransform

          protected Transform getTransform()

      Return the `Transform` object to use to transform the `Value` to the correct data type.
      Returns:
        Transform

    - #### isCaseSensitive

          public boolean isCaseSensitive()

      Get the indicator if the value is case sensitive
      Returns:
        boolean indicating if the value is case sensitive

    - #### isSigned

          public boolean isSigned()

      Get the indicator if the value is considered a signed value.
      Returns:
        boolean indicating if value is signed.

    - #### getRepresentationClass

          public Class<?> getRepresentationClass()

      Get the Java class used to represent values for this type.
      Returns:
        the representation class; never null

    - #### getNominalDisplaySize

          public int getNominalDisplaySize()

      Get the nominal display size for the given type. This may not be large enough for certain string and binary values.
      Returns:
        the nominal display size; always positive
      See Also:
        `ResultSetMetaData.getColumnDisplaySize(int)`

    - #### translateValue

          public Object translateValue(Value value)
                                throws SQLException

      Throws:
        `SQLException`

    - #### translateValueToJDBC

          public static Object translateValueToJDBC(Value value)
                                             throws SQLException

      Throws:
        `SQLException`

    - #### typeInfo

          public static JcrType typeInfo(String jcrTypeName)

    - #### typeInfo

          public static JcrType typeInfo(int jcrType)

    - #### jdbcType

          public static String jdbcType(String jcrTypeName)

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.