1 28 29 package com.caucho.amber.table; 30 31 import java.util.Comparator ; 32 33 36 public class ColumnCompare implements Comparator <Column> { 37 40 public int compare(Column a, Column b) 41 { 42 if (a.isPrimaryKey() && ! b.isPrimaryKey()) 43 return -1; 44 else if (b.isPrimaryKey() && ! a.isPrimaryKey()) 45 return 1; 46 else 47 return a.getName().compareTo(b.getName()); 48 } 49 } 50 | Popular Tags |