Class JDBCTypeInfo
- java.lang.Object
-
- org.datanucleus.store.rdbms.schema.JDBCTypeInfo
-
- All Implemented Interfaces:
org.datanucleus.store.schema.MapStoreSchemaData
,org.datanucleus.store.schema.StoreSchemaData
public class JDBCTypeInfo extends java.lang.Object implements org.datanucleus.store.schema.MapStoreSchemaData
Representation of JDBC type information in the datastore. Each JDBC type info has a map of SQL type info for this JDBC type. Has the property "jdbc_type" as a Short of the java.sql.Types value.
-
-
Field Summary
Fields Modifier and Type Field Description private int
hash
Hashcode.(package private) java.util.Map<java.lang.String,java.lang.Object>
properties
Properties of the JDBC type.(package private) java.util.Map<java.lang.String,org.datanucleus.store.schema.StoreSchemaData>
sqlTypes
SQL types for this JDBC type, keyed by (SQL) type name.
-
Constructor Summary
Constructors Constructor Description JDBCTypeInfo(short type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(org.datanucleus.store.schema.StoreSchemaData child)
Add a SQL type for this JDBC type.void
addProperty(java.lang.String name, java.lang.Object value)
Method to add a property for the type.void
clearChildren()
Method to remove all children.boolean
equals(java.lang.Object obj)
Indicates whether some object is "equal to" this one.org.datanucleus.store.schema.StoreSchemaData
getChild(java.lang.String key)
Accessor for the SQL type with this type name (if supported for this JDBC type).java.util.Map
getChildren()
Accessor for the SQL types map for this JDBC type, keyed by the type name.int
getNumberOfChildren()
org.datanucleus.store.schema.StoreSchemaData
getParent()
Accessor for the parent component.java.lang.Object
getProperty(java.lang.String name)
Accessor for a property.int
hashCode()
Returns a hash code value for this object.void
setDefaultChild(java.lang.String sqlTypeName)
Set the default child to be used.void
setParent(org.datanucleus.store.schema.StoreSchemaData parent)
Mutator for the parent component.java.lang.String
toString()
Returns the string representation of this object.
-
-
-
Field Detail
-
hash
private int hash
Hashcode. Set on first use.
-
properties
java.util.Map<java.lang.String,java.lang.Object> properties
Properties of the JDBC type.
-
sqlTypes
java.util.Map<java.lang.String,org.datanucleus.store.schema.StoreSchemaData> sqlTypes
SQL types for this JDBC type, keyed by (SQL) type name.
-
-
Method Detail
-
setParent
public void setParent(org.datanucleus.store.schema.StoreSchemaData parent)
Mutator for the parent component.- Specified by:
setParent
in interfaceorg.datanucleus.store.schema.MapStoreSchemaData
- Parameters:
parent
- Parent component
-
getParent
public org.datanucleus.store.schema.StoreSchemaData getParent()
Accessor for the parent component.- Specified by:
getParent
in interfaceorg.datanucleus.store.schema.MapStoreSchemaData
- Returns:
- null
-
addProperty
public void addProperty(java.lang.String name, java.lang.Object value)
Method to add a property for the type.- Specified by:
addProperty
in interfaceorg.datanucleus.store.schema.StoreSchemaData
- Parameters:
name
- Name of propertyvalue
- Its value
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Accessor for a property.- Specified by:
getProperty
in interfaceorg.datanucleus.store.schema.StoreSchemaData
- Parameters:
name
- Name of the property- Returns:
- Its value, or null if not defined
-
addChild
public void addChild(org.datanucleus.store.schema.StoreSchemaData child)
Add a SQL type for this JDBC type.- Specified by:
addChild
in interfaceorg.datanucleus.store.schema.MapStoreSchemaData
- Parameters:
child
- The SQL type
-
setDefaultChild
public void setDefaultChild(java.lang.String sqlTypeName)
Set the default child to be used. If this child is not a current value then it will be ignored.- Parameters:
sqlTypeName
- SQL Type to use as the default for this JDBC type
-
clearChildren
public void clearChildren()
Method to remove all children.- Specified by:
clearChildren
in interfaceorg.datanucleus.store.schema.MapStoreSchemaData
-
getChild
public org.datanucleus.store.schema.StoreSchemaData getChild(java.lang.String key)
Accessor for the SQL type with this type name (if supported for this JDBC type).- Specified by:
getChild
in interfaceorg.datanucleus.store.schema.MapStoreSchemaData
- Parameters:
key
- type name- Returns:
- the SQL type
-
getChildren
public java.util.Map getChildren()
Accessor for the SQL types map for this JDBC type, keyed by the type name.- Specified by:
getChildren
in interfaceorg.datanucleus.store.schema.MapStoreSchemaData
- Returns:
- Map of SQL types
-
getNumberOfChildren
public int getNumberOfChildren()
- Specified by:
getNumberOfChildren
in interfaceorg.datanucleus.store.schema.MapStoreSchemaData
-
equals
public final boolean equals(java.lang.Object obj)
Indicates whether some object is "equal to" this one. Two JDBCTypeInfo are considered equal if their jdbc type is the same.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the reference object with which to compare- Returns:
- true if this object is equal to the obj argument; false otherwise.
-
hashCode
public final int hashCode()
Returns a hash code value for this object.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a hash code value for this object.
-
toString
public java.lang.String toString()
Returns the string representation of this object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- string representation of this object.
-
-