org.datanucleus.metadata
Class IdentityMetaData

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

public class IdentityMetaData
extends MetaData
implements ColumnMetaDataContainer

Meta-Data for the datastore-identity of a class. Provides a surrogate datastore field. Also defines the generation strategy for the identity values.

See Also:
Serialized Form

Field Summary
protected  ColumnMetaData[] columnMetaData
          Metadata for columns.
protected  java.lang.String columnName
          column name value.
protected  java.lang.String sequence
          sequence tag value.
protected  IdentityStrategy strategy
          strategy tag value.
protected  java.lang.String valueGeneratorName
          Name of a value generator if the user wants to override the default generator.
 
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
IdentityMetaData()
          Default constructor.
 
Method Summary
 void addColumn(ColumnMetaData colmd)
          Add a new ColumnMetaData element
 ColumnMetaData[] getColumnMetaData()
          Accessor for columnMetaData
 java.lang.String getColumnName()
          Accessor for the column name.
 java.lang.String getSequence()
          Accessor for the sequence name
 java.lang.String getValueGeneratorName()
          Name of a (user-provided) value generator to override the default generator for this strategy.
 IdentityStrategy getValueStrategy()
          Accessor for the strategy tag value
 void initialise(ClassLoaderResolver clr, MetaDataManager mmgr)
          Method to initialise all internal convenience arrays needed.
 ColumnMetaData newColumnMetaData()
          Method to create a new ColumnMetaData, add it, and return it.
 IdentityMetaData setColumnName(java.lang.String columnName)
           
 IdentityMetaData setSequence(java.lang.String sequence)
           
 IdentityMetaData setValueGeneratorName(java.lang.String generator)
          Mutator for the name of the value generator to use for this strategy.
 IdentityMetaData setValueStrategy(IdentityStrategy strategy)
           
 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

columnName

protected java.lang.String columnName
column name value.


strategy

protected IdentityStrategy strategy
strategy tag value.


sequence

protected java.lang.String sequence
sequence tag value.


valueGeneratorName

protected java.lang.String valueGeneratorName
Name of a value generator if the user wants to override the default generator.


columnMetaData

protected ColumnMetaData[] columnMetaData
Metadata for columns.

Constructor Detail

IdentityMetaData

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

Method Detail

initialise

public void initialise(ClassLoaderResolver clr,
                       MetaDataManager mmgr)
Method to initialise all internal convenience arrays needed.

Overrides:
initialise in class MetaData

addColumn

public void addColumn(ColumnMetaData colmd)
Add a new ColumnMetaData element

Specified by:
addColumn in interface ColumnMetaDataContainer
Parameters:
colmd - The ColumnMetaData to add

newColumnMetaData

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

Returns:
The Column metadata

getColumnMetaData

public final ColumnMetaData[] getColumnMetaData()
Accessor for columnMetaData

Specified by:
getColumnMetaData in interface ColumnMetaDataContainer
Returns:
Returns the columnMetaData.

getColumnName

public java.lang.String getColumnName()
Accessor for the column name.

Returns:
column name

setColumnName

public IdentityMetaData setColumnName(java.lang.String columnName)
Parameters:
columnName - the columnName to set

getValueStrategy

public IdentityStrategy getValueStrategy()
Accessor for the strategy tag value

Returns:
strategy tag value

setValueStrategy

public IdentityMetaData setValueStrategy(IdentityStrategy strategy)
Parameters:
strategy - the strategy to set

getSequence

public java.lang.String getSequence()
Accessor for the sequence name

Returns:
sequence name

setSequence

public IdentityMetaData setSequence(java.lang.String sequence)
Parameters:
sequence - the sequence to set

getValueGeneratorName

public java.lang.String getValueGeneratorName()
Name of a (user-provided) value generator to override the default generator for this strategy.

Returns:
Name of user provided value generator

setValueGeneratorName

public IdentityMetaData setValueGeneratorName(java.lang.String generator)
Mutator for the name of the value generator to use for this strategy.

Parameters:
generator - Name of value generator

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 © 2010. All Rights Reserved.