1 28 29 package com.caucho.db.sql; 30 31 import java.sql.SQLException ; 32 33 36 class LongOrder extends Order { 37 private int _column; 38 39 LongOrder(int column) 40 { 41 _column = column; 42 } 43 44 public int compare(SelectResult result, int indexA, int indexB) 45 throws SQLException 46 { 47 result.setRow(indexA); 48 49 long valueA = result.getLong(_column); 50 if (result.wasNull()) 51 valueA = Long.MIN_VALUE; 52 53 result.setRow(indexB); 54 55 long valueB = result.getLong(_column); 56 if (result.wasNull()) 57 valueB = Long.MIN_VALUE; 58 59 if (valueA < valueB) 60 return isAscending() ? -1 : 1; 61 else if (valueA == valueB) 62 return _next == null ? 0 : _next.compare(result, indexA, indexB); 63 else 64 return isAscending() ? 1 : -1; 65 } 66 } 67 | Popular Tags |