1 package com.jofti.query; 2 3 import com.jofti.api.IndexQuery; 4 import com.jofti.core.QueryId; 5 import com.jofti.core.QueryType; 6 import com.jofti.util.ReflectionUtil; 7 8 19 public class MatchNotQuery implements IndexQuery, QueryId { 20 21 Class className; 22 String propertyName; 23 Comparable value; 24 25 public final Object alias; 26 final QueryType QUERY_ID =QueryType.NOT_QUERY; 27 28 43 44 public MatchNotQuery(Class className, String propertyName, Comparable value){ 45 this(className,propertyName,value,null); 46 } 47 48 public MatchNotQuery(Class className, String propertyName, Comparable value,Object alias){ 49 this.className = className; 50 this.propertyName = propertyName; 51 this.value = value; 52 this.alias =alias; 53 } 54 55 70 71 public MatchNotQuery(String className, String propertyName, Comparable value){ 72 this(className,propertyName,value,null); 73 } 74 75 public MatchNotQuery(String className, String propertyName, Comparable value,Object alias){ 76 Class clazz = null; 77 try{ 78 clazz = ReflectionUtil.classForName(className); 79 }catch (Exception e){ 80 throw new RuntimeException (e); 81 } 82 this.className = clazz; 83 this.propertyName = propertyName; 84 this.value = value; 85 this.alias =alias; 86 } 87 104 public MatchNotQuery(Comparable value){ 105 this.value = value; 106 this.alias =null; 107 } 108 111 public Class getClassName() { 112 return className; 113 } 114 115 118 public String getPropertyName() { 119 return propertyName; 120 } 121 122 125 public Comparable getValue() { 126 return value; 127 } 128 129 public QueryType getQueryType() 130 { 131 132 return QUERY_ID; 133 } 134 135 136 public Object getAlias() { 137 return alias; 138 } 139 140 public IndexQuery setParameter(String name, Object value) { 141 throw new UnsupportedOperationException ("Parameters are not supported for convenience classes"); 142 } 143 146 public IndexQuery setParameter(int position, Object value) { 147 throw new UnsupportedOperationException ("Parameters are not supported for convenience classes"); 148 149 } 150 151 public IndexQuery setFirstResult(int firstResult) { 152 throw new UnsupportedOperationException ("result limits are not supported for convenience classes"); 153 154 } 155 public IndexQuery setMaxResults(int maxResults) { 156 throw new UnsupportedOperationException ("result limits are not supported for convenience classes"); 157 158 } 159 } 160 | Popular Tags |