net.java.ao.types
Class SchemaProperties

java.lang.Object
  extended by net.java.ao.types.SchemaProperties

public class SchemaProperties
extends Object

Describes the underlying SQL schema type that corresponds to a given TypeInfo. This is determined by the database provider.


Method Summary
 SchemaProperties defaultValueAllowed(boolean defaultValueAllowed)
          Returns a new instance with the same properties, but specifying whether or not a column of this type can have a default value.
 boolean equals(Object o)
           
 Integer getOverrideJdbcWriteType()
          Returns the JDBC type code to be used when writing to the database (e.g.
 String getSqlTypeName()
          Returns the SQL type name (without any precision or length qualifiers).
 int hashCode()
           
 boolean hasOverrideJdbcWriteType()
          Returns true if this instance specifies a JDBC type code that is different than the default from the LogicalType.
 boolean isDefaultValueAllowed()
          Returns true if a column of this type is allowed to have a default value.
 boolean isPrecisionAllowed()
          Returns true if this type is allowed to have a numeric precision qualifier.
 boolean isScaleAllowed()
          Returns true if this type is allowed to have a numeric scale qualifier.
 boolean isStringLengthAllowed()
          Returns true if this type is allowed to have a string length qualifier.
 SchemaProperties jdbcWriteType(int jdbcWriteType)
          Returns a new instance with the same properties, but specifying a JDBC type code.
 SchemaProperties precisionAllowed(boolean precisionAllowed)
          Returns a new instance with the same properties, but specifying whether or not the SQL type can include a numeric precision qualifier.
 SchemaProperties scaleAllowed(boolean scaleAllowed)
          Returns a new instance with the same properties, but specifying whether or not the SQL type can include a numeric scale qualifier.
static SchemaProperties schemaType(String sqlTypeName)
          Constructs an instance that refers to the specified SQL type name (e.g.
 SchemaProperties stringLengthAllowed(boolean stringLengthAllowed)
          Returns a new instance with the same properties, but specifying whether or not the SQL type can include a string length qualifier.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

schemaType

public static SchemaProperties schemaType(String sqlTypeName)
Constructs an instance that refers to the specified SQL type name (e.g. "VARCHAR").


jdbcWriteType

public SchemaProperties jdbcWriteType(int jdbcWriteType)
Returns a new instance with the same properties, but specifying a JDBC type code. This overrides the value given by the LogicalType.


precisionAllowed

public SchemaProperties precisionAllowed(boolean precisionAllowed)
Returns a new instance with the same properties, but specifying whether or not the SQL type can include a numeric precision qualifier. This is false by default.


scaleAllowed

public SchemaProperties scaleAllowed(boolean scaleAllowed)
Returns a new instance with the same properties, but specifying whether or not the SQL type can include a numeric scale qualifier. This is false by default.


stringLengthAllowed

public SchemaProperties stringLengthAllowed(boolean stringLengthAllowed)
Returns a new instance with the same properties, but specifying whether or not the SQL type can include a string length qualifier. This is false by default.


defaultValueAllowed

public SchemaProperties defaultValueAllowed(boolean defaultValueAllowed)
Returns a new instance with the same properties, but specifying whether or not a column of this type can have a default value. This is true by default.


getSqlTypeName

public String getSqlTypeName()
Returns the SQL type name (without any precision or length qualifiers).


getOverrideJdbcWriteType

public Integer getOverrideJdbcWriteType()
Returns the JDBC type code to be used when writing to the database (e.g. Types.VARCHAR), if this is different than the default from the LogicalType.


hasOverrideJdbcWriteType

public boolean hasOverrideJdbcWriteType()
Returns true if this instance specifies a JDBC type code that is different than the default from the LogicalType.


isPrecisionAllowed

public boolean isPrecisionAllowed()
Returns true if this type is allowed to have a numeric precision qualifier.


isScaleAllowed

public boolean isScaleAllowed()
Returns true if this type is allowed to have a numeric scale qualifier.


isStringLengthAllowed

public boolean isStringLengthAllowed()
Returns true if this type is allowed to have a string length qualifier.


isDefaultValueAllowed

public boolean isDefaultValueAllowed()
Returns true if a column of this type is allowed to have a default value.


equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2007-2014. All Rights Reserved.