1 package com.jofti.query.namespace; 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 MatchNSInQuery implements IndexQuery, QueryId { 20 21 Class className; 22 String propertyName; 23 Comparable [] values; 24 Object nameSpace; 25 public final Object alias; 26 27 static final QueryType QUERY_ID=QueryType.IN_NS_QUERY; 28 29 44 public MatchNSInQuery(Class className, Object nameSpace, String propertyName, Comparable [] values){ 45 this(className,nameSpace, propertyName,values,null); 46 } 47 public MatchNSInQuery(Class className, Object nameSpace, String propertyName, Comparable [] values,Object alias){ 48 this.className = className; 49 this.nameSpace = nameSpace; 50 this.propertyName = propertyName; 51 this.values = values; 52 this.alias = alias; 53 } 54 55 public MatchNSInQuery(String className, Object nameSpace, String propertyName, Comparable [] values){ 56 this(className,nameSpace,propertyName,values,null); 57 } 58 public MatchNSInQuery(String className, Object nameSpace,String propertyName, Comparable [] values,Object alias){ 59 Class clazz = null; 60 try{ 61 clazz = ReflectionUtil.classForName(className); 62 }catch (Exception e){ 63 throw new RuntimeException (e); 64 } 65 this.nameSpace = nameSpace; 66 this.className = clazz; 67 this.propertyName = propertyName; 68 this.values = values; 69 this.alias = alias; 70 } 71 87 public MatchNSInQuery(Comparable [] values){ 88 this.values = values; 89 this.alias =null; 90 } 91 94 public Class getClassName() { 95 return className; 96 } 97 98 101 public String getPropertyName() { 102 return propertyName; 103 } 104 105 108 public Comparable [] getValues() { 109 return values; 110 } 111 112 public QueryType getQueryType() 113 { 114 return QUERY_ID; 115 } 116 117 118 public Object getNameSpace() { 119 return nameSpace; 120 } 121 public void setNameSpace(Object nameSpace) { 122 this.nameSpace = nameSpace; 123 } 124 public Object getAlias() { 125 return alias; 126 } 127 130 public IndexQuery setParameter(String name, Object value) { 131 throw new UnsupportedOperationException ("Parameters are not supported for convenience classes"); 132 } 133 136 public IndexQuery setParameter(int position, Object value) { 137 throw new UnsupportedOperationException ("Parameters are not supported for convenience classes"); 138 139 } 140 public IndexQuery setFirstResult(int firstResult) { 141 throw new UnsupportedOperationException ("Result limitation is not supported for convenience classes"); 142 } 143 public IndexQuery setMaxResults(int maxResults) { 144 throw new UnsupportedOperationException ("Result limitation is not supported for convenience classes"); 145 } 146 147 } 148 | Popular Tags |