首页 > 解决方案 > 过滤器中的自定义 propertyConverter 在 Neo4j OGM 中被覆盖

问题描述

我在 Neo4j OGM 中手动设置过滤器的 propertyConverter。

filter.setPropertyConverter(new EnumArrayStringConverter(VendorCostStatus.class));
filters.add(filter);

但是当我调用 session.loadAll(DomainClass.class , filters) 时,它被LoadByTypeDelegate.loadAll(Class<T> type, Filters filters)

但是随后 LoadByTypeDelegate 通过调用覆盖过滤器的 propertyConverter

resolvePropertyAnnotations(Class entityType, Iterable<Filter> filters)

并设置域类中属性的默认转换器。

谁能告诉我如何让 neo4j-ogm 使用过滤器中提供的自定义属性转换器?我想ComparisonOperator.IN用于枚举属性

标签: javaneo4jspring-data-neo4jsdnneo4j-ogm

解决方案


设置您自己的属性转换器已被弃用,无论如何,我相信它从来没有以这种意图构建。这似乎是一个不应该暴露但当时却暴露的api。


推荐阅读