1 5 package com.jofti.query; 6 7 import com.jofti.api.IndexQuery; 8 import com.jofti.core.QueryId; 9 import com.jofti.core.QueryType; 10 11 67 public class Query implements IndexQuery, QueryId { 68 69 int hashCode =0; 70 String query = null; 71 static final QueryType QUERY_ID=QueryType.UNPARSED_QUERY; 72 73 private static final String TERMINATOR =";"; 74 75 78 public Query(String query){ 79 this.query = query + TERMINATOR; 80 } 81 82 public String getQuery(){ 83 return this.query; 84 } 85 86 public QueryType getQueryType() 87 { 88 return QUERY_ID; 89 } 90 91 public int hashCode(){ 92 if (hashCode ==0){ 93 hashCode = query.hashCode(); 94 } 95 return hashCode; 96 } 97 98 public boolean equals(Object obj){ 99 return query.equals(obj); 100 } 101 102 public IndexQuery setParameter(String name, Object value) { 103 throw new UnsupportedOperationException ("Parameters are not supported for convenience classes"); 104 } 105 108 public IndexQuery setParameter(int position, Object value) { 109 throw new UnsupportedOperationException ("Parameters are not supported for convenience classes"); 110 111 } 112 113 public IndexQuery setFirstResult(int firstResult) { 114 return null; 116 } 117 118 public IndexQuery setMaxResults(int maxResults) { 119 return null; 121 } 122 } 123 | Popular Tags |