if(p1.getEmployee()!=null && p2.getEmployee()!=null) { chain.addComparator(new ReverseComparator(new BeanComparator("employee.employeeNumber"))); }
chain.addComparator(new ReverseComparator(new BeanComparator("username")));
			public int compare(Object o1, Object o2) {				Person p1 = (Person) ((MetaObject)o1).getObject();				Person p2 = (Person) ((MetaObject)o2).getObject();				ComparatorChain chain = new ComparatorChain();			    chain.addComparator(new CategoryComparator());			    			    if(p1.getEmployee()!=null && p2.getEmployee()!=null) {			    	chain.addComparator(new ReverseComparator(new BeanComparator("employee.employeeNumber")));			    }			    return chain.compare(p1, p2);			}