|
|
|
@ -60,7 +60,9 @@ public class QueryMapper { |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public DBObject getMappedObject(DBObject query, MongoPersistentEntity<?> entity) { |
|
|
|
public DBObject getMappedObject(DBObject query, MongoPersistentEntity<?> entity) { |
|
|
|
|
|
|
|
|
|
|
|
String idKey = null; |
|
|
|
String idKey = null; |
|
|
|
|
|
|
|
|
|
|
|
if (null != entity && entity.getIdProperty() != null) { |
|
|
|
if (null != entity && entity.getIdProperty() != null) { |
|
|
|
idKey = entity.getIdProperty().getName(); |
|
|
|
idKey = entity.getIdProperty().getName(); |
|
|
|
} else if (query.containsField("id")) { |
|
|
|
} else if (query.containsField("id")) { |
|
|
|
@ -87,7 +89,6 @@ public class QueryMapper { |
|
|
|
value = getMappedObject((DBObject) value, entity); |
|
|
|
value = getMappedObject((DBObject) value, entity); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
value = convertId(value); |
|
|
|
value = convertId(value); |
|
|
|
} |
|
|
|
} |
|
|
|
newKey = "_id"; |
|
|
|
newKey = "_id"; |
|
|
|
@ -100,10 +101,13 @@ public class QueryMapper { |
|
|
|
newConditions.add(getMappedObject((DBObject) iter.next(), entity)); |
|
|
|
newConditions.add(getMappedObject((DBObject) iter.next(), entity)); |
|
|
|
} |
|
|
|
} |
|
|
|
value = newConditions; |
|
|
|
value = newConditions; |
|
|
|
|
|
|
|
} else if (key.equals("$ne")) { |
|
|
|
|
|
|
|
value = convertId(value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
newDbo.put(newKey, value); |
|
|
|
newDbo.put(newKey, value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return newDbo; |
|
|
|
return newDbo; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|