Revision 44748 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/expressionevaluator/impl/function/dataaccess/SelectFunction.java
SelectFunction.java | ||
---|---|---|
35 | 35 |
import org.gvsig.expressionevaluator.spi.AbstractFunction; |
36 | 36 |
import org.gvsig.fmap.dal.DALLocator; |
37 | 37 |
import org.gvsig.fmap.dal.DataManager; |
38 |
import static org.gvsig.fmap.dal.DataManager.FUNCTION_SELECT; |
|
38 | 39 |
import org.gvsig.fmap.dal.DataStore; |
39 | 40 |
import org.gvsig.fmap.dal.feature.Feature; |
40 | 41 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
... | ... | |
49 | 50 |
|
50 | 51 |
public SelectFunction() { |
51 | 52 |
super(DALFunctions.GROUP_DATA_ACCESS, |
52 |
DALFunctions.FUNCTION_SELECT,
|
|
53 |
FUNCTION_SELECT, |
|
53 | 54 |
Range.between(1,5), |
54 | 55 |
"Returns a list of features of the table by applying the filter, order and limit indicated.\n"+ |
55 | 56 |
"The syntax is:\n\n"+ |
... | ... | |
64 | 65 |
"limit - Maximum number of features to return" |
65 | 66 |
}, |
66 | 67 |
"List", |
67 |
true
|
|
68 |
false
|
|
68 | 69 |
); |
69 | 70 |
} |
70 | 71 |
|
... | ... | |
87 | 88 |
public boolean useArgumentsInsteadObjects() { |
88 | 89 |
return true; |
89 | 90 |
} |
90 |
|
|
91 |
|
|
91 | 92 |
@Override |
92 | 93 |
public Object call(Interpreter interpreter, Object[] args) throws Exception { |
93 | 94 |
throw new UnsupportedOperationException(); |
... | ... | |
112 | 113 |
try { |
113 | 114 |
DataStore store = this.getStore(storeName); |
114 | 115 |
if (store == null ) { |
115 |
throw new ExpressionRuntimeException("Cant locate the store '" + storeName + "' in function '" + DALFunctions.FUNCTION_SELECT + "'.");
|
|
116 |
throw new ExpressionRuntimeException("Cant locate the store '" + storeName + "' in function '" + FUNCTION_SELECT + "'."); |
|
116 | 117 |
} |
117 | 118 |
if (!(store instanceof FeatureStore)) { |
118 |
throw new ExpressionRuntimeException("The store'" + storeName + "' is not valid for function '" + DALFunctions.FUNCTION_SELECT + "', a FeatureStore is required.");
|
|
119 |
throw new ExpressionRuntimeException("The store'" + storeName + "' is not valid for function '" + FUNCTION_SELECT + "', a FeatureStore is required."); |
|
119 | 120 |
} |
120 | 121 |
FeatureStore featureStore = (FeatureStore) store; |
121 | 122 |
List<Feature> features; |
... | ... | |
141 | 142 |
} catch (ExpressionRuntimeException ex) { |
142 | 143 |
throw ex; |
143 | 144 |
} catch (Exception ex) { |
144 |
throw new ExpressionRuntimeException("Problems calling '" + DALFunctions.FUNCTION_SELECT + "' function", ex);
|
|
145 |
throw new ExpressionRuntimeException("Problems calling '" + FUNCTION_SELECT + "' function", ex); |
|
145 | 146 |
} |
146 | 147 |
} |
147 | 148 |
|
Also available in: Unified diff