org.datanucleus.metadata
Class OrderMetaData

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

public class OrderMetaData
extends MetaData
implements ColumnMetaDataContainer

Representation of Order MetaData - the ordering of the elements of a List. This caters for 2 types of List.

Version:
$Revision: 1.20 $
See Also:
Serialized Form

Nested Class Summary
static class OrderMetaData.FieldOrder
          Definition of ordering using a field.
 
Field Summary
protected  ColumnMetaData[] columnMetaData
          Contains the metadata for column
protected  OrderMetaData.FieldOrder[] fieldOrders
          Ordering of fields (when using "ordered List").
protected  IndexedValue indexed
          The indexing value specified as input.
protected  IndexMetaData indexMetaData
          IndexMetaData.
protected  java.lang.String mappedBy
          Name of the field in the element that is the ordering field.
protected  java.lang.String ordering
          Ordering when using an "ordered list" where the elements are retrieved in a particular order.
 
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
OrderMetaData(MetaData parent, OrderMetaData omd)
          Constructor to create a copy of the passed metadata using the provided parent.
OrderMetaData(java.lang.String ordering)
          Constructor when defining an "ordered list" (like JPA1)
OrderMetaData(java.lang.String column, java.lang.String indexed, java.lang.String mappedBy)
          Constructor when defining an "indexed list" (like JDO2).
 
Method Summary
 void addColumn(ColumnMetaData colmd)
          Add a new ColumnMetaData element
 ColumnMetaData[] getColumnMetaData()
          Accessor for the Column MetaData for the columns
 java.lang.String getColumnName()
          Accessor for the column name
 OrderMetaData.FieldOrder[] getFieldOrders()
          Accessor for field ordering (if using "ordered List".
 IndexMetaData getIndexMetaData()
          Accessor for indexMetaData
 java.lang.String getMappedBy()
          Accessor for the field in the element that provides the ordering.
 void initialise()
          Method to initialise the object, creating internal convenience arrays.
 boolean isIndexedList()
          Convenience method to return if the List is an "indexed List" like in JDO2.
 void setIndexMetaData(IndexMetaData indexMetaData)
          Mutator for the index MetaData
 java.lang.String toString(java.lang.String prefix, java.lang.String indent)
          Returns a string representation of the object using a prefix This can be used as part of a facility to output a MetaData file.
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, removeExtension, setInitialised, setParent, setPopulated, setUsed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

indexMetaData

protected IndexMetaData indexMetaData
IndexMetaData.


indexed

protected IndexedValue indexed
The indexing value specified as input.


mappedBy

protected final java.lang.String mappedBy
Name of the field in the element that is the ordering field.


ordering

protected java.lang.String ordering
Ordering when using an "ordered list" where the elements are retrieved in a particular order. Only used until initialise().


fieldOrders

protected OrderMetaData.FieldOrder[] fieldOrders
Ordering of fields (when using "ordered List").


columnMetaData

protected ColumnMetaData[] columnMetaData
Contains the metadata for column

Constructor Detail

OrderMetaData

public OrderMetaData(MetaData parent,
                     OrderMetaData omd)
Constructor to create a copy of the passed metadata using the provided parent.

Parameters:
parent - The parent
omd - The metadata to copy

OrderMetaData

public OrderMetaData(java.lang.String column,
                     java.lang.String indexed,
                     java.lang.String mappedBy)
Constructor when defining an "indexed list" (like JDO2).

Parameters:
column - Name of column
indexed - The indexed value
mappedBy - The field in the element that provides the ordering

OrderMetaData

public OrderMetaData(java.lang.String ordering)
Constructor when defining an "ordered list" (like JPA1)

Parameters:
ordering - ordering when using an ordered list where the elements are retrieved in a particular order
Method Detail

initialise

public void initialise()
Method to initialise the object, creating internal convenience arrays. Initialises all sub-objects.

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 Column MetaData

setIndexMetaData

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

Parameters:
indexMetaData - The indexMetaData to set.

isIndexedList

public boolean isIndexedList()
Convenience method to return if the List is an "indexed List" like in JDO2.

Returns:
Whether the List is indexed (if false means that it is "ordered" (like in JPA1)

getMappedBy

public java.lang.String getMappedBy()
Accessor for the field in the element that provides the ordering.

Returns:
Field in the value that provides the ordering.

getFieldOrders

public OrderMetaData.FieldOrder[] getFieldOrders()
Accessor for field ordering (if using "ordered List".

Returns:
Field orders

getColumnMetaData

public final ColumnMetaData[] getColumnMetaData()
Accessor for the Column MetaData for the columns

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

getColumnName

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

Returns:
Returns the column.

getIndexMetaData

public final IndexMetaData getIndexMetaData()
Accessor for indexMetaData

Returns:
Returns the indexMetaData.

toString

public java.lang.String toString(java.lang.String prefix,
                                 java.lang.String indent)
Returns a string representation of the object using a prefix This can be used as part of a facility to output a MetaData file.

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


Copyright © 2009. All Rights Reserved.