Package net.java.ao.types
Class TypeQualifiers
java.lang.Object
net.java.ao.types.TypeQualifiers
Describes optional modifiers to a type: string length for string types, precision and scale
for numeric types. Each
TypeInfo may have default qualifiers set by the database
provider; qualifiers may also be modified by annotations.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum string length (for strings of limited length) cannot be set to greater than this value.static final intString sizes were tuned down due to a SQL server limitation, this has the undesired side effect that existing tables read with lengths between 450 and 767 are incorrectly seen as clobsstatic final intIfstringLengthis set to this constant, the field is an unlimited-length string (TEXT, CLOB, or LONG VARCHAR). -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareCompatible(TypeQualifiers derivedFromEntityAnnotations, TypeQualifiers derivedFromTableMetadata) booleanIf there is a disparity between reportedLength and the stringLength then the field is incompatiblebooleangetScale()inthashCode()booleanbooleanhasScale()booleanbooleanbooleanbooleanprecision(int precision) static TypeQualifiersscale(int scale) stringLength(int stringLength) toString()withQualifiers(TypeQualifiers overrides)
-
Field Details
-
MAX_STRING_LENGTH
public static final int MAX_STRING_LENGTHMaximum string length (for strings of limited length) cannot be set to greater than this value. This is the lowest common denominator for maximum string length in all supported databases.- See Also:
-
OLD_MAX_STRING_LENGTH
public static final int OLD_MAX_STRING_LENGTHString sizes were tuned down due to a SQL server limitation, this has the undesired side effect that existing tables read with lengths between 450 and 767 are incorrectly seen as clobs- See Also:
-
UNLIMITED_LENGTH
public static final int UNLIMITED_LENGTHIfstringLengthis set to this constant, the field is an unlimited-length string (TEXT, CLOB, or LONG VARCHAR).- See Also:
-
-
Method Details
-
qualifiers
-
precision
-
scale
-
stringLength
-
withQualifiers
-
getPrecision
-
getScale
-
getStringLength
-
isDefined
public boolean isDefined() -
hasPrecision
public boolean hasPrecision() -
hasScale
public boolean hasScale() -
hasStringLength
public boolean hasStringLength() -
isUnlimitedLength
public boolean isUnlimitedLength() -
areLengthsCorrect
public boolean areLengthsCorrect()If there is a disparity between reportedLength and the stringLength then the field is incompatible -
isUnlimitedStringLengthSupportCompatible
-
areCompatible
public static boolean areCompatible(TypeQualifiers derivedFromEntityAnnotations, TypeQualifiers derivedFromTableMetadata) -
equals
-
hashCode
public int hashCode() -
toString
-