details: /erp/devel/pi/rev/983998780371
changeset: 12381:983998780371
user: Asier Lostalé <asier.lostale <at> openbravo.com>
date: Tue May 24 16:43:47 2011 +0200
summary: backed out dd0fc0ef1fd1 issue 17019
diffstat:
modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
| 26 ++-------
1 files changed, 7 insertions(+), 19 deletions(-)
diffs (83 lines):
diff -r 885ce0f76269 -r 983998780371
modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
---
a/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
Tue May 24 16:19:03 2011 +0200
+++
b/modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
Tue May 24 16:43:47 2011 +0200
@@ -35,7 +35,6 @@
import org.openbravo.base.model.Entity;
import org.openbravo.base.model.ModelProvider;
import org.openbravo.base.model.Property;
-import org.openbravo.base.model.domaintype.SearchDomainType;
import org.openbravo.base.structure.IdentifierProvider;
import org.openbravo.base.util.Check;
import org.openbravo.client.kernel.RequestContext;
@@ -370,7 +369,9 @@
if (fieldName.equals(JsonConstants.IDENTIFIER)
|| fieldName.endsWith("." + JsonConstants.IDENTIFIER)) {
clause = computeLeftWhereClauseForIdentifier(property, fieldName,
clause);
- } else if (!isPrimitive(property)) {
+ }
+
+ if (!property.isPrimitive()) {
clause = clause + ".id";
}
@@ -403,7 +404,7 @@
clause = alias;
}
- if (!isPrimitive(property)) {
+ if (!property.isPrimitive()) {
// an in parameter use it...
if
(localValue.toString().contains(JsonConstants.IN_PARAMETER_SEPARATOR)) {
final List<String> values = new ArrayList<String>();
@@ -433,7 +434,7 @@
return value;
}
// a FK
- if (!isPrimitive(property)) {
+ if (!property.isPrimitive()) {
return value;
}
if (isLike(operator)) {
@@ -457,10 +458,6 @@
return typedValues;
}
- if (property.getDomainType() instanceof SearchDomainType) {
- return value;
- }
-
if (Boolean.class == property.getPrimitiveObjectType()) {
return new Boolean(value.toString());
} else if (property.isNumericType()) {
@@ -785,7 +782,7 @@
// not supported ignoring it
continue;
}
- if (!isPrimitive(prop)) {
+ if (!prop.isPrimitive()) {
// get identifier properties from target entity
// TODO: currently only supports one level, recursive
// calls have the danger of infinite loops in case of
@@ -909,7 +906,7 @@
// check if any new JoinDefinitions should be created
for (int i = (joinedPropertyIndex + 1); i < props.size(); i++) {
final Property prop = props.get(i);
- if (isPrimitive(prop)) {
+ if (prop.isPrimitive()) {
break;
}
// a joinable property
@@ -1000,13 +997,4 @@
public void setCriteria(JSONObject criteria) {
this.criteria = criteria;
}
-
- /**
- * Returns whether current property is primitive, old selectors are treated
as primitive for
- * filtering purposes.
- *
- */
- private boolean isPrimitive(Property prop) {
- return prop.isPrimitive() || prop.getDomainType() instanceof
SearchDomainType;
- }
}
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits