简体   繁体   English

访问neo4j-ogm的映射上下文

[英]Access to neo4j-ogm's mapping context

I'm using neo4j-ogm 2.1.1 and I need to clear entities from the neo4j-ogm's mapping context manually . 我正在使用neo4j-ogm 2.1.1, 需要从neo4j-ogm的映射上下文中手动清除实体

I need this because I'm deleting entities with custom CYPHER queries and I need to correctly clean the mapping context to remove deleted entities. 我需要这样做是因为我正在使用自定义CYPHER查询删除实体,并且需要正确清理映射上下文以删除已删除的实体。

Since org.neo4j.ogm.Session is not exposing the context, and I'm not able to cast Session to an Neo4jSession, does someone know how to access this underlying context ? 由于org.neo4j.ogm.Session没有公开上下文,并且我无法将Session转换为Neo4jSession,有人知道如何访问此基础上下文吗?

Or am I in a wrong direction and should I choose a different approach ? 还是我走错了方向,应该选择其他方法吗?

It seems I can use this method on the org.neo4j.ogm.Session: 看来我可以在org.neo4j.ogm.Session上使用此方法:

session.detachNodeEntity(id) session.detachNodeEntity(id)

It seems to be working fine for what I want. 对于我想要的东西,它似乎工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM