1 package org.apache.torque.util; 2 3 21 22 32 public class SqlEnum implements java.io.Serializable 33 { 34 37 private static final long serialVersionUID = 5963149836513364800L; 38 39 private final String s; 40 41 private SqlEnum(String s) 42 { 43 this.s = s; 44 } 45 46 public final String toString() 47 { 48 return s; 49 } 50 51 public static final SqlEnum EQUAL = 52 new SqlEnum("="); 53 public static final SqlEnum NOT_EQUAL = 54 new SqlEnum("<>"); 55 public static final SqlEnum ALT_NOT_EQUAL = 56 new SqlEnum("!="); 57 public static final SqlEnum GREATER_THAN = 58 new SqlEnum(">"); 59 public static final SqlEnum LESS_THAN = 60 new SqlEnum("<"); 61 public static final SqlEnum GREATER_EQUAL = 62 new SqlEnum(">="); 63 public static final SqlEnum LESS_EQUAL = 64 new SqlEnum("<="); 65 public static final SqlEnum LIKE = 66 new SqlEnum(" LIKE "); 67 public static final SqlEnum NOT_LIKE = 68 new SqlEnum(" NOT LIKE "); 69 public static final SqlEnum ILIKE = 70 new SqlEnum(" ILIKE "); 71 public static final SqlEnum NOT_ILIKE = 72 new SqlEnum(" NOT ILIKE "); 73 public static final SqlEnum IN = 74 new SqlEnum(" IN "); 75 public static final SqlEnum NOT_IN = 76 new SqlEnum(" NOT IN "); 77 public static final SqlEnum CUSTOM = 78 new SqlEnum("CUSTOM"); 79 public static final SqlEnum JOIN = 80 new SqlEnum("JOIN"); 81 public static final SqlEnum DISTINCT = 82 new SqlEnum("DISTINCT "); 83 public static final SqlEnum ALL = 84 new SqlEnum("ALL "); 85 public static final SqlEnum ASC = 86 new SqlEnum("ASC"); 87 public static final SqlEnum DESC = 88 new SqlEnum("DESC"); 89 public static final SqlEnum ISNULL = 90 new SqlEnum(" IS NULL "); 91 public static final SqlEnum ISNOTNULL = 92 new SqlEnum(" IS NOT NULL "); 93 public static final SqlEnum CURRENT_DATE = 94 new SqlEnum("CURRENT_DATE"); 95 public static final SqlEnum CURRENT_TIME = 96 new SqlEnum("CURRENT_TIME"); 97 public static final SqlEnum LEFT_JOIN = 98 new SqlEnum(" LEFT JOIN "); 99 public static final SqlEnum RIGHT_JOIN = 100 new SqlEnum(" RIGHT JOIN "); 101 public static final SqlEnum INNER_JOIN = 102 new SqlEnum(" INNER JOIN "); 103 public static final SqlEnum ON = 104 new SqlEnum(" ON "); 105 public static final SqlEnum AS = 106 new SqlEnum(" AS "); 107 public static final SqlEnum ESCAPE = 108 new SqlEnum(" ESCAPE "); 109 110 115 public boolean equals(Object o) 116 { 117 if (o == null) 118 { 119 return false; 120 } 121 122 if (!(o instanceof SqlEnum)) 123 { 124 return false; 125 } 126 127 SqlEnum otherEnum = (SqlEnum) o; 128 129 130 return (otherEnum.s == null) 134 ? (s == null) 135 : otherEnum.s.equals(s); 136 } 137 138 141 public int hashCode() 142 { 143 return (s == null) 144 ? 0 145 : s.hashCode(); 146 } 147 } 148 | Popular Tags |