/** * Returns whether the given {@link String} is the type key. * * @param key * @return * @see MongoTypeMapper#isTypeKey(String) * @since 2.2 */ protected boolean isTypeKey(String key) { return converter.getTypeMapper().isTypeKey(key); }
private Document updateTypeRestrictions(Document query, Example example) { Document result = new Document(); if (isTypeRestricting(example)) { result.putAll(query); this.converter.getTypeMapper().writeTypeRestrictions(result, getTypesToMatch(example)); return result; } for (Map.Entry<String, Object> entry : query.entrySet()) { if (!this.converter.getTypeMapper().isTypeKey(entry.getKey())) { result.put(entry.getKey(), entry.getValue()); } } return result; }
private boolean isTypeRestricting(Example example) { if (example.getMatcher() instanceof UntypedExampleMatcher) { return false; } if (example.getMatcher().getIgnoredPaths().isEmpty()) { return true; } for (String path : example.getMatcher().getIgnoredPaths()) { if (this.converter.getTypeMapper().isTypeKey(path)) { return false; } } return true; }
this.converter.getTypeMapper().writeTypeRestrictions(result, restrictedTypes);
/** * Returns whether the given {@link String} is the type key. * * @param key * @return * @see MongoTypeMapper#isTypeKey(String) * @since 2.2 */ protected boolean isTypeKey(String key) { return converter.getTypeMapper().isTypeKey(key); }
private Document updateTypeRestrictions(Document query, Example example) { Document result = new Document(); if (isTypeRestricting(example)) { result.putAll(query); this.converter.getTypeMapper().writeTypeRestrictions(result, getTypesToMatch(example)); return result; } for (Map.Entry<String, Object> entry : query.entrySet()) { if (!this.converter.getTypeMapper().isTypeKey(entry.getKey())) { result.put(entry.getKey(), entry.getValue()); } } return result; }
private boolean isTypeRestricting(Example example) { if (example.getMatcher() instanceof UntypedExampleMatcher) { return false; } if (example.getMatcher().getIgnoredPaths().isEmpty()) { return true; } for (String path : example.getMatcher().getIgnoredPaths()) { if (this.converter.getTypeMapper().isTypeKey(path)) { return false; } } return true; }
this.converter.getTypeMapper().writeTypeRestrictions(result, restrictedTypes);
private Serializable readObject(DBObject dbObject) throws ClassNotFoundException { TypeInformation<?> information = mapper.getTypeMapper().readType(dbObject); if (information == null) { return null; } return (Serializable) mapper.read(information.getType(), dbObject); }