Revision 23221 branches/v2_0_0_prep/libraries/libFMap_data_eval_SQLJEP/src/org/gvsig/fmap/data/feature/expressionevaluator/sqljep/FeatureFilterSQLJEP.java
FeatureFilterSQLJEP.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.util.Map.Entry; |
4 | 4 |
|
5 |
import org.gvsig.tools.exception.BaseException; |
|
6 | 5 |
import org.gvsig.fmap.data.ReadException; |
7 | 6 |
import org.gvsig.fmap.data.feature.Feature; |
8 | 7 |
import org.gvsig.fmap.data.feature.FeatureType; |
... | ... | |
13 | 12 |
import org.gvsig.fmap.data.feature.expressionevaluator.sqljep.functions.Intersects; |
14 | 13 |
import org.gvsig.fmap.data.feature.expressionevaluator.sqljep.functions.Overlaps; |
15 | 14 |
import org.gvsig.fmap.data.index.Index; |
15 |
import org.gvsig.tools.exception.BaseException; |
|
16 | 16 |
import org.gvsig.tools.visitor.Visitor; |
17 | 17 |
import org.medfoster.sqljep.BaseJEP; |
18 | 18 |
import org.medfoster.sqljep.function.PostfixCommand; |
... | ... | |
54 | 54 |
} |
55 | 55 |
|
56 | 56 |
public Entry getVariable(String arg0) { |
57 |
return new FeatureEntry(arg0); |
|
57 |
if (this.featureType.getDefaultGeometry() != null |
|
58 |
&& this.featureType.getDefaultGeometry().equals(arg0)) { |
|
59 |
return new DefaultGeometryEntry(arg0); |
|
60 |
} else { |
|
61 |
int pos = this.findColumn(arg0); |
|
62 |
if (pos < 0) { |
|
63 |
throw new RuntimeException("attribute name '" + arg0 |
|
64 |
+ "' not found"); |
|
65 |
} |
|
66 |
return new FeatureEntry(arg0, pos); |
|
67 |
} |
|
58 | 68 |
} |
59 | 69 |
|
60 | 70 |
/** |
... | ... | |
87 | 97 |
return value.compareTo(Boolean.TRUE) == 0; |
88 | 98 |
} |
89 | 99 |
|
100 |
protected class DefaultGeometryEntry implements Entry { |
|
101 |
private String key; |
|
102 |
|
|
103 |
public DefaultGeometryEntry(String arg0) { |
|
104 |
this.key = arg0; |
|
105 |
} |
|
106 |
|
|
107 |
public Object getKey() { |
|
108 |
return this.key; |
|
109 |
} |
|
110 |
|
|
111 |
public Object getValue() { |
|
112 |
return feature.getDefaultGeometry(); |
|
113 |
} |
|
114 |
|
|
115 |
public Object setValue(Object value) { |
|
116 |
// TODO Auto-generated method stub |
|
117 |
return null; |
|
118 |
} |
|
119 |
|
|
120 |
} |
|
121 |
|
|
90 | 122 |
protected class FeatureEntry implements Entry { |
91 | 123 |
private String key; |
124 |
private int position; |
|
92 | 125 |
|
93 |
public FeatureEntry(String key) { |
|
126 |
public FeatureEntry(String key, int position) {
|
|
94 | 127 |
this.key = key; |
128 |
this.position = position; |
|
95 | 129 |
} |
96 | 130 |
|
97 | 131 |
public Object getKey() { |
... | ... | |
99 | 133 |
} |
100 | 134 |
|
101 | 135 |
public Object getValue() { |
102 |
Object value = feature.get(this.key);
|
|
136 |
Object value = feature.get(this.position);
|
|
103 | 137 |
return value; |
104 | 138 |
} |
105 | 139 |
|
Also available in: Unified diff