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.

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  java.lang.String columnName
          The name of the column (if specified as input)
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()
          Constructor for an ordering.
OrderMetaData(OrderMetaData omd)
          Constructor to create a copy of the passed metadata.
 
Method Summary
 void addColumn(ColumnMetaData colmd)
          Add a new ColumnMetaData element
 ColumnMetaData[] getColumnMetaData()
          Accessor for columnMetaData
 java.lang.String getColumnName()
           
 OrderMetaData.FieldOrder[] getFieldOrders()
           
 IndexMetaData getIndexMetaData()
           
 java.lang.String getMappedBy()
           
 java.lang.String getOrdering()
           
 void initialise(ClassLoaderResolver clr, MetaDataManager mmgr)
          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.
 ColumnMetaData newColumnMetaData()
          Method to create a new column metadata, set it, and return it.
 IndexMetaData newIndexMetaData()
          Method to create a new index metadata, set it, and return it.
 OrderMetaData setColumnName(java.lang.String column)
           
 OrderMetaData setIndexed(IndexedValue val)
           
 OrderMetaData setIndexMetaData(IndexMetaData indexMetaData)
           
 OrderMetaData setMappedBy(java.lang.String mappedby)
           
 OrderMetaData setOrdering(java.lang.String ordering)
           
 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, 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
The name of the column (if specified as input)


indexMetaData

protected IndexMetaData indexMetaData
IndexMetaData.


indexed

protected IndexedValue indexed
The indexing value specified as input.


mappedBy

protected 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(OrderMetaData omd)
Constructor to create a copy of the passed metadata.

Parameters:
omd - The metadata to copy

OrderMetaData

public OrderMetaData()
Constructor for an ordering. Can be JDO (indexed) or JPA (ordered).

Method Detail

initialise

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

Overrides:
initialise in class MetaData

addColumn

public void addColumn(ColumnMetaData colmd)
Description copied from interface: ColumnMetaDataContainer
Add a new ColumnMetaData element

Specified by:
addColumn in interface ColumnMetaDataContainer
Parameters:
colmd - The Column MetaData

newColumnMetaData

public ColumnMetaData newColumnMetaData()
Method to create a new column metadata, set it, and return it.

Returns:
The column metadata

setIndexed

public final OrderMetaData setIndexed(IndexedValue val)

setIndexMetaData

public final OrderMetaData setIndexMetaData(IndexMetaData indexMetaData)

newIndexMetaData

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

Returns:
The index metadata

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()

setMappedBy

public OrderMetaData setMappedBy(java.lang.String mappedby)

getFieldOrders

public OrderMetaData.FieldOrder[] getFieldOrders()

getColumnMetaData

public final ColumnMetaData[] getColumnMetaData()
Description copied from interface: ColumnMetaDataContainer
Accessor for columnMetaData

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

getColumnName

public final java.lang.String getColumnName()

setColumnName

public OrderMetaData setColumnName(java.lang.String column)

getIndexMetaData

public final IndexMetaData getIndexMetaData()

getOrdering

public java.lang.String getOrdering()

setOrdering

public OrderMetaData setOrdering(java.lang.String ordering)

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