自定义propertyConverter在Neo4j OGM中被覆盖 [英] custom propertyConverter in filter is getting overridden in Neo4j OGM

查看:156
本文介绍了自定义propertyConverter在Neo4j OGM中被覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am manually setting propertyConverter of a filter in Neo4j OGM.

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

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

But then when I call session.loadAll(DomainClass.class, filters), it is picked by LoadByTypeDelegate.loadAll(Class<T> type, Filters filters)

但是,然后LoadByTypeDelegate通过调用

But then LoadByTypeDelegate overrides the propertyConverter of the filter by calling

resolvePropertyAnnotations(Class entityType, Iterable<Filter> filters)

,并在域类中设置属性的默认转换器.

and sets the default converter of the property in the domain class.

有人可以告诉我如何使neo4j-ogm使用过滤器中提供的自定义属性转换器吗?我想将ComparisonOperator.IN用于枚举属性

Could anyone please tell me how to make neo4j-ogm use the custom property converter provided in the filter? I want to use ComparisonOperator.IN for enum attributes

推荐答案

不建议设置您自己的属性转换器,无论如何,我相信它绝不是出于这种目的而构建的.看来这是一个不应该公开的api,但在当时是这样.

Setting your own property converter is deprecated, and anyway, I believe it was never built with that intention. It seems to be an api that should not have been exposed but was at the time.

这篇关于自定义propertyConverter在Neo4j OGM中被覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆