au.gov.tas.dpiwe.mr.relationship
Class EntityBeanComparator
java.lang.Object
au.gov.tas.dpiwe.mr.relationship.EntityBeanComparator
- All Implemented Interfaces:
- Comparator
public class EntityBeanComparator
- extends Object
- implements Comparator
A comparator which orders entity beans based on their primary key values.
- Since:
- Mr Architecture 2.0
- Version:
- 1.0.0.0
- Author:
- Kade Hansson
container
protected Container container
EntityBeanComparator
public EntityBeanComparator(Container container)
- Construct a entity bean comparator.
- Parameters:
container - a container which knows the primary key getter method of the beans.
compare
public int compare(Object first,
Object second)
- Compares two entity beans.
- Specified by:
compare in interface Comparator
- Parameters:
first - the first bean.second - the second bean.
- Returns:
- -1 if first before second, 0 if first equals second, or 1 if first after second.
- Throws:
EJBException - if the beans are of different types or have differing implementations.
equals
public boolean equals(Object other)
- Compares two entity bean comparators.
- Specified by:
equals in interface Comparator- Overrides:
equals in class Object
- Returns:
- true.