28 |
28 |
import java.util.List;
|
29 |
29 |
import java.util.Map;
|
30 |
30 |
import org.apache.commons.lang3.ArrayUtils;
|
|
31 |
import org.apache.commons.lang3.BooleanUtils;
|
31 |
32 |
import org.apache.commons.lang3.StringUtils;
|
32 |
33 |
import org.gvsig.expressionevaluator.Code;
|
33 |
34 |
import org.gvsig.expressionevaluator.Expression;
|
... | ... | |
47 |
48 |
import org.gvsig.fmap.dal.feature.FeatureType;
|
48 |
49 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCConnection;
|
49 |
50 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper;
|
|
51 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer;
|
|
52 |
import static org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer.QUERY_DONT_ADD_PRIMARY_KEY_IN_THE_ORDER;
|
50 |
53 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference;
|
51 |
54 |
import org.gvsig.fmap.dal.store.jdbc2.ResulSetControler.ResultSetEntry;
|
52 |
55 |
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase;
|
... | ... | |
56 |
59 |
import static org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase.PROP_SYMBOLTABLE;
|
57 |
60 |
import static org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase.PROP_TABLE;
|
58 |
61 |
import org.gvsig.fmap.geom.DataTypes;
|
|
62 |
import org.gvsig.tools.dataTypes.DataTypeUtils;
|
59 |
63 |
import org.gvsig.tools.dynobject.DynField;
|
60 |
64 |
import org.gvsig.tools.evaluator.Evaluator;
|
61 |
65 |
import org.gvsig.tools.lang.CloneableUtils;
|
... | ... | |
492 |
496 |
select.disable_check_order_and_offset();
|
493 |
497 |
} else {
|
494 |
498 |
// Siempre ordenamos por la clave primaria
|
495 |
|
for (String attrName : primaryKeys) {
|
496 |
|
if (select.getOrderBy(attrName) == null) {
|
497 |
|
select.order_by().column(attrName).ascending();
|
|
499 |
Object x = query==null? null:query.getQueryParameter(QUERY_DONT_ADD_PRIMARY_KEY_IN_THE_ORDER);
|
|
500 |
if( x==null || DataTypeUtils.toBoolean(x) ) {
|
|
501 |
for (String attrName : primaryKeys) {
|
|
502 |
if (select.getOrderBy(attrName) == null) {
|
|
503 |
select.order_by().column(attrName).ascending();
|
|
504 |
}
|
498 |
505 |
}
|
499 |
506 |
}
|
500 |
507 |
}
|