Class RDBMSSchemaInfo
- java.lang.Object
-
- org.datanucleus.store.rdbms.schema.RDBMSSchemaInfo
-
- All Implemented Interfaces:
org.datanucleus.store.schema.MapStoreSchemaData
,org.datanucleus.store.schema.StoreSchemaData
public class RDBMSSchemaInfo extends java.lang.Object implements org.datanucleus.store.schema.MapStoreSchemaData
Representation of schema table information in the datastore. Stores a map of tables, keyed by the table name. Supports the following properties :-- catalog Catalog containing the tables
- schema Schema containing the tables
-
-
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 schema.(package private) java.util.Map<java.lang.String,org.datanucleus.store.schema.StoreSchemaData>
tables
Table information for this schema, keyed by table name.
-
Constructor Summary
Constructors Constructor Description RDBMSSchemaInfo(java.lang.String catalog, java.lang.String schema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(org.datanucleus.store.schema.StoreSchemaData data)
Method to add another table to the schema.void
addProperty(java.lang.String name, java.lang.Object value)
Method to add a property for the schema.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 table with this key.java.util.Map<java.lang.String,org.datanucleus.store.schema.StoreSchemaData>
getChildren()
Accessor for the tables.int
getNumberOfChildren()
Accessor for the number of tables in the schema for this schema.org.datanucleus.store.schema.StoreSchemaData
getParent()
java.lang.Object
getProperty(java.lang.String name)
Accessor for a property of the schema.int
hashCode()
Returns a hash code value for this object.void
setParent(org.datanucleus.store.schema.StoreSchemaData parent)
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 schema.
-
tables
java.util.Map<java.lang.String,org.datanucleus.store.schema.StoreSchemaData> tables
Table information for this schema, keyed by table name.
-
-
Method Detail
-
addChild
public void addChild(org.datanucleus.store.schema.StoreSchemaData data)
Method to add another table to the schema. Will key the table into its Map using the table property "table_key".- Specified by:
addChild
in interfaceorg.datanucleus.store.schema.MapStoreSchemaData
- Parameters:
data
- Child information (RDBMSTableInfo)- Throws:
org.datanucleus.exceptions.NucleusException
- Thrown if the table has no property "table_key"
-
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 table with this key.- Specified by:
getChild
in interfaceorg.datanucleus.store.schema.MapStoreSchemaData
- Parameters:
key
- Key of the table- Returns:
- Table with this key
-
getChildren
public java.util.Map<java.lang.String,org.datanucleus.store.schema.StoreSchemaData> getChildren()
Accessor for the tables.- Specified by:
getChildren
in interfaceorg.datanucleus.store.schema.MapStoreSchemaData
- Returns:
- Tables
-
getNumberOfChildren
public int getNumberOfChildren()
Accessor for the number of tables in the schema for this schema.- Specified by:
getNumberOfChildren
in interfaceorg.datanucleus.store.schema.MapStoreSchemaData
- Returns:
- Number of tables
-
addProperty
public void addProperty(java.lang.String name, java.lang.Object value)
Method to add a property for the schema.- 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 of the schema.- Specified by:
getProperty
in interfaceorg.datanucleus.store.schema.StoreSchemaData
- Parameters:
name
- Name of the property- Returns:
- Its value, or null if not defined
-
getParent
public org.datanucleus.store.schema.StoreSchemaData getParent()
- Specified by:
getParent
in interfaceorg.datanucleus.store.schema.MapStoreSchemaData
-
setParent
public void setParent(org.datanucleus.store.schema.StoreSchemaData parent)
- Specified by:
setParent
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 RDBMSSchemaInfo are considered equal if their catalog, schema are all equal.- 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:
- hash code
-
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.
-
-