Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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
`static class` | `JcrType.DefaultDataTypes`

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

Method Summary
`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 `JcrType.DefaultDataTypes` value.
`String` | `getJdbcTypeName()` Get the native type name associated with the JDBC `JcrType.DefaultDataTypes` 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 `JcrType.DefaultDataTypes` value.

  Returns:
    the JDBC type; never null

### getJdbcTypeName

    public String getJdbcTypeName()

  Get the native type name associated with the JDBC `JcrType.DefaultDataTypes` 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)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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