org.apache.openjpa.meta
Class MetaDataInheritanceComparator

java.lang.Object
  extended by org.apache.openjpa.meta.InheritanceComparator
      extended by org.apache.openjpa.meta.MetaDataInheritanceComparator
All Implemented Interfaces:
Serializable, Comparator
Direct Known Subclasses:
AnnotationPersistenceMetaDataSerializer.SerializationComparator, XMLPersistenceMetaDataSerializer.SerializationComparator

public class MetaDataInheritanceComparator
extends InheritanceComparator

Comparator that keeps metadatas in inheritance order. Also places relation types used as primary keys before the primary key field owner types.

Author:
Abe White
See Also:
Serialized Form

Constructor Summary
MetaDataInheritanceComparator()
           
 
Method Summary
 int compare(Object o1, Object o2)
           
protected  Class toClass(Object elem)
          Subclasses can override this method to extract the class to compare on from the elements of the collection.
 
Methods inherited from class org.apache.openjpa.meta.InheritanceComparator
getBase, setBase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

MetaDataInheritanceComparator

public MetaDataInheritanceComparator()
Method Detail

toClass

protected Class toClass(Object elem)
Description copied from class: InheritanceComparator
Subclasses can override this method to extract the class to compare on from the elements of the collection.

Overrides:
toClass in class InheritanceComparator

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator
Overrides:
compare in class InheritanceComparator


Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.