org.datanucleus.metadata
Class DiscriminatorMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.DiscriminatorMetaData
All Implemented Interfaces:
java.io.Serializable

public class DiscriminatorMetaData
extends MetaData

Representation of a discriminator in an inheritance strategy.

See Also:
Serialized Form

Field Summary
protected  ColumnMetaData columnMetaData
          Discriminator column
protected  java.lang.String columnName
          Column name of discriminator
protected  IndexedValue indexed
          Whether the discriminator is indexed or not and whether it is unique
protected  IndexMetaData indexMetaData
          Definition of any indexing of the discriminator column.
protected  DiscriminatorStrategy strategy
          strategy tag value.
protected  java.lang.String value
          Value for discriminator column
 
Fields inherited from class org.datanucleus.metadata.MetaData
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD
 
Constructor Summary
DiscriminatorMetaData()
          Default constructor.
DiscriminatorMetaData(DiscriminatorMetaData dmd)
          Constructor to copy from the supplied discriminator metadata.
 
Method Summary
 ColumnMetaData getColumnMetaData()
          Accessor for column MetaData.
 java.lang.String getColumnName()
           
 IndexedValue getIndexed()
           
 IndexMetaData getIndexMetaData()
          Accessor for indexMetaData
 DiscriminatorStrategy getStrategy()
           
 java.lang.String getValue()
           
 void initialise(ClassLoaderResolver clr, MetaDataManager mmgr)
          Initialisation method.
 ColumnMetaData newColumnMetaData()
          Method to create a new ColumnMetaData, add it, and return it.
 IndexMetaData newIndexMetaData()
          Method to create a new Index metadata, add it, and return it.
 void setColumnMetaData(ColumnMetaData columnMetaData)
          Mutator for column MetaData.
 DiscriminatorMetaData setColumnName(java.lang.String columnName)
           
 DiscriminatorMetaData setIndexed(IndexedValue indexed)
           
 DiscriminatorMetaData setIndexed(java.lang.String indexed)
           
 void setIndexMetaData(IndexMetaData indexMetaData)
          Mutator for the index MetaData
 DiscriminatorMetaData setStrategy(DiscriminatorStrategy strategy)
           
 DiscriminatorMetaData setStrategy(java.lang.String strategy)
           
 DiscriminatorMetaData setValue(java.lang.String value)
           
 java.lang.String toString(java.lang.String prefix, java.lang.String indent)
          Returns a string representation of the object using a prefix
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, assertIfInitialised, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, newExtensionMetaData, removeExtension, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

strategy

protected DiscriminatorStrategy strategy
strategy tag value.


columnName

protected java.lang.String columnName
Column name of discriminator


value

protected java.lang.String value
Value for discriminator column


indexed

protected IndexedValue indexed
Whether the discriminator is indexed or not and whether it is unique


columnMetaData

protected ColumnMetaData columnMetaData
Discriminator column


indexMetaData

protected IndexMetaData indexMetaData
Definition of any indexing of the discriminator column.

Constructor Detail

DiscriminatorMetaData

public DiscriminatorMetaData(DiscriminatorMetaData dmd)
Constructor to copy from the supplied discriminator metadata.

Parameters:
dmd - DiscriminatorMetaData

DiscriminatorMetaData

public DiscriminatorMetaData()
Default constructor. Set fields using setters, before populate().

Method Detail

initialise

public void initialise(ClassLoaderResolver clr,
                       MetaDataManager mmgr)
Initialisation method. This should be called AFTER using the populate method if you are going to use populate. It creates the internal convenience arrays etc needed for normal operation.

Overrides:
initialise in class MetaData

getColumnMetaData

public ColumnMetaData getColumnMetaData()
Accessor for column MetaData.

Returns:
Returns the column MetaData.

setColumnMetaData

public void setColumnMetaData(ColumnMetaData columnMetaData)
Mutator for column MetaData.

Parameters:
columnMetaData - The column MetaData to set.

newColumnMetaData

public ColumnMetaData newColumnMetaData()
Method to create a new ColumnMetaData, add it, and return it.

Returns:
The Column metadata

getIndexMetaData

public final IndexMetaData getIndexMetaData()
Accessor for indexMetaData

Returns:
Returns the indexMetaData.

setIndexMetaData

public final void setIndexMetaData(IndexMetaData indexMetaData)
Mutator for the index MetaData

Parameters:
indexMetaData - The indexMetaData to set.

newIndexMetaData

public IndexMetaData newIndexMetaData()
Method to create a new Index metadata, add it, and return it.

Returns:
The Index metadata

getValue

public java.lang.String getValue()

setValue

public DiscriminatorMetaData setValue(java.lang.String value)

getColumnName

public java.lang.String getColumnName()

setColumnName

public DiscriminatorMetaData setColumnName(java.lang.String columnName)

getStrategy

public final DiscriminatorStrategy getStrategy()

setStrategy

public DiscriminatorMetaData setStrategy(DiscriminatorStrategy strategy)

setStrategy

public DiscriminatorMetaData setStrategy(java.lang.String strategy)

getIndexed

public IndexedValue getIndexed()

setIndexed

public DiscriminatorMetaData setIndexed(IndexedValue indexed)

setIndexed

public DiscriminatorMetaData setIndexed(java.lang.String indexed)

toString

public java.lang.String toString(java.lang.String prefix,
                                 java.lang.String indent)
Returns a string representation of the object using a prefix

Overrides:
toString in class MetaData
Parameters:
prefix - prefix string
indent - indent string
Returns:
a string representation of the object.


Copyright © 2011. All Rights Reserved.